#pd-game {
    --pd-bg: #fff8e9;
    --pd-card: #ffffff;
    --pd-primary: #6c4ccf;
    --pd-primary-dark: #5032a8;
    --pd-secondary: #ffbd59;
    --pd-green: #269b69;
    --pd-red: #df5555;
    --pd-text: #343044;
    --pd-muted: #77718a;
    --pd-border: #e8e1f4;

    width: 100%;
    max-width: 900px;
    margin: 25px auto;
    padding: 22px;
    background: var(--pd-bg);
    border-radius: 22px;
    color: var(--pd-text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    box-sizing: border-box;
}

#pd-game *,
#pd-game *::before,
#pd-game *::after {
    box-sizing: border-box;
}

#pd-game button,
#pd-game input,
#pd-game select {
    font: inherit;
}

#pd-game button {
    cursor: pointer;
}

#pd-game button:focus-visible,
#pd-game input:focus-visible,
#pd-game select:focus-visible {
    outline: 3px solid #222;
    outline-offset: 3px;
}

#pd-game .pd-header {
    text-align: center;
    margin-bottom: 22px;
}

#pd-game .pd-title {
    color: var(--pd-primary);
    font-size: clamp(25px, 5vw, 36px);
    font-weight: 900;
    margin: 0 0 5px;
    line-height: 1.2;
}

#pd-game .pd-subtitle {
    color: var(--pd-muted);
    margin: 5px 0 0;
}

#pd-game .pd-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

#pd-game .pd-stat {
    background: var(--pd-card);
    border-radius: 13px;
    padding: 11px 5px;
    text-align: center;
    border: 1px solid var(--pd-border);
}

#pd-game .pd-stat-label {
    font-size: 12px;
    color: var(--pd-muted);
    display: block;
    font-weight: bold;
}

#pd-game .pd-stat-value {
    font-size: 21px;
    font-weight: 900;
    color: var(--pd-primary);
}

#pd-game .pd-panel {
    background: var(--pd-card);
    border: 1px solid var(--pd-border);
    border-radius: 17px;
    padding: 20px;
    margin-bottom: 17px;
}

#pd-game .pd-section-title {
    font-size: 17px;
    font-weight: 900;
    margin: 0 0 12px;
    color: var(--pd-primary);
}

#pd-game .pd-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

#pd-game .pd-field label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 6px;
}

#pd-game select {
    width: 100%;
    padding: 11px;
    border: 1px solid var(--pd-border);
    border-radius: 10px;
    background: #fff;
    color: var(--pd-text);
}

#pd-game .pd-checkbox-row {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 14px;
    font-size: 14px;
}

#pd-game .pd-checkbox-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--pd-primary);
}

#pd-game .pd-main-btn {
    background: var(--pd-primary);
    color: white;
    border: none;
    border-radius: 11px;
    padding: 13px 22px;
    font-weight: bold;
    transition: background .2s, transform .2s;
}

#pd-game .pd-main-btn:hover {
    background: var(--pd-primary-dark);
    transform: translateY(-2px);
}

#pd-game .pd-secondary-btn {
    background: var(--pd-secondary);
    color: #493516;
    border: none;
    border-radius: 11px;
    padding: 12px 17px;
    font-weight: bold;
}

#pd-game .pd-light-btn {
    background: #eee9fa;
    color: var(--pd-primary);
    border: 1px solid #ddd2f5;
    border-radius: 11px;
    padding: 11px 16px;
    font-weight: bold;
}

#pd-game .pd-danger-btn {
    background: #fff0f0;
    color: var(--pd-red);
    border: 1px solid #f5d0d0;
    border-radius: 11px;
    padding: 11px 16px;
    font-weight: bold;
}

#pd-game .pd-start-area {
    text-align: center;
    padding: 15px 0 5px;
}

#pd-game .pd-progress-wrap {
    margin: 15px 0 20px;
}

#pd-game .pd-progress-info {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 7px;
}

#pd-game .pd-progress-bar {
    height: 11px;
    background: #eee9f5;
    border-radius: 20px;
    overflow: hidden;
}

#pd-game .pd-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #8c69e5, #4ebc91);
    border-radius: 20px;
    transition: width .3s;
}

#pd-game .pd-category-tag {
    display: inline-block;
    background: #eee8ff;
    color: var(--pd-primary);
    border-radius: 30px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 12px;
}

#pd-game .pd-definition {
    font-size: 19px;
    line-height: 1.5;
    font-weight: bold;
    text-align: center;
    margin: 12px auto 8px;
    max-width: 650px;
}

#pd-game .pd-word-length {
    text-align: center;
    color: var(--pd-muted);
    font-size: 13px;
    margin: 8px 0 18px;
}

#pd-game .pd-letters {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    min-height: 65px;
    margin: 15px 0;
}

#pd-game .pd-tile {
    width: 47px;
    height: 49px;
    border: 2px solid #dcd2f3;
    background: #f3efff;
    color: var(--pd-primary);
    border-radius: 11px;
    font-size: 22px;
    font-weight: 900;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform .15s, background .15s;
    padding: 0;
}

#pd-game .pd-tile:hover {
    background: #e5dcff;
    transform: translateY(-3px);
}

#pd-game .pd-tile:disabled {
    opacity: .35;
    cursor: default;
    transform: none;
}

#pd-game .pd-answer-zone {
    min-height: 70px;
    padding: 12px;
    background: #faf8ff;
    border: 2px dashed #c9b9ec;
    border-radius: 13px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 14px 0;
}

#pd-game .pd-answer-zone .pd-tile {
    background: #e3f5e9;
    border-color: #a4d9b7;
    color: #23734b;
}

#pd-game .pd-answer-placeholder {
    color: #aaa3b6;
    font-size: 14px;
    text-align: center;
}

#pd-game .pd-input {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--pd-border);
    border-radius: 11px;
    font-size: 19px;
    text-align: center;
    text-transform: uppercase;
    margin: 8px 0 13px;
    color: var(--pd-text);
}

#pd-game .pd-controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

#pd-game .pd-feedback {
    min-height: 35px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    margin: 13px 0 0;
}

#pd-game .pd-feedback.success {
    color: var(--pd-green);
}

#pd-game .pd-feedback.error {
    color: var(--pd-red);
}

#pd-game .pd-feedback.info {
    color: var(--pd-primary);
}

#pd-game .pd-hint-box {
    display: none;
    background: #fff7df;
    border-left: 4px solid #ffbd59;
    padding: 12px;
    margin-top: 12px;
    border-radius: 8px;
    font-size: 14px;
}

#pd-game .pd-hint-box.show {
    display: block;
}

#pd-game .pd-mode-label {
    text-align: center;
    font-size: 13px;
    color: var(--pd-muted);
    margin-bottom: 8px;
}

#pd-game .pd-hidden {
    display: none !important;
}

#pd-game .pd-finish {
    text-align: center;
    padding: 25px 10px;
}

#pd-game .pd-finish-icon {
    font-size: 65px;
}

#pd-game .pd-finish h3 {
    font-size: 27px;
    color: var(--pd-primary);
}

#pd-game .pd-final-score {
    font-size: 38px;
    font-weight: 900;
    color: var(--pd-green);
    margin: 10px;
}

#pd-game .pd-summary {
    max-width: 400px;
    margin: 20px auto;
    background: #f8f5ff;
    padding: 15px;
    border-radius: 13px;
    text-align: left;
}

#pd-game .pd-summary p {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
}

#pd-game .pd-small {
    color: var(--pd-muted);
    font-size: 12px;
    text-align: center;
}

#pd-game .pd-keyboard-help {
    text-align: center;
    color: var(--pd-muted);
    font-size: 12px;
    margin-top: 12px;
}

@media(max-width: 600px) {
    #pd-game {
        padding: 13px;
        border-radius: 14px;
    }

    #pd-game .pd-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    #pd-game .pd-settings-grid {
        grid-template-columns: 1fr;
    }

    #pd-game .pd-panel {
        padding: 14px;
    }

    #pd-game .pd-definition {
        font-size: 17px;
    }

    #pd-game .pd-tile {
        width: 40px;
        height: 43px;
        font-size: 19px;
    }

    #pd-game .pd-controls button {
        flex: 1 1 42%;
    }

    #pd-game .pd-input {
        font-size: 17px;
    }
}

@media(prefers-reduced-motion: reduce) {
    #pd-game *,
    #pd-game *::before,
    #pd-game *::after {
        transition: none !important;
        animation: none !important;
    }
}

