/* Word Scramble — Game Worlds (dark slate + cyan, matches Mine Finder family) */

@media screen and (max-height: 640px) {
    .container.container-single {
        padding-top: 3px !important;
    }
}

.wsc-gw#gamebox,
#gamebox.wsc-gw {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    min-height: 520px;
    margin: 0;
    padding: 0;
    position: relative;
    overflow: hidden;
    text-align: center;

    font-family:
        ui-sans-serif,
        system-ui,
        -apple-system,
        'Segoe UI',
        Roboto,
        'Helvetica Neue',
        Arial,
        sans-serif;

    color: #e2e8f0;
    background:
        radial-gradient(ellipse 100% 65% at 50% 0%, rgba(34, 211, 238, 0.08) 0%, transparent 52%),
        linear-gradient(165deg, #0b0f14 0%, #111827 48%, #0a0d12 100%);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 18px 44px rgba(0, 0, 0, 0.5);
}

.wsc-gw input:focus,
.wsc-gw button:focus {
    outline: none;
}

.wsc-gw input:focus-visible,
.wsc-gw button:focus-visible {
    box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.45);
}

.wsc-header#header,
#header.wsc-header {
    float: none;
    width: 100%;
    min-height: auto;
    height: auto;
    margin: 0;
    padding: 14px 16px 16px;

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;

    font-size: 0.875rem;
    font-weight: 600;
    color: #cbd5e1;

    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
}

.wsc-stat {
    float: none;
    width: auto;
    min-width: 0;
    text-align: left;
    flex: 0 1 auto;

    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(30, 41, 59, 0.55);
    border: 1px solid rgba(100, 116, 139, 0.35);
}

.wsc-stat--time {
    text-align: right;
    margin-left: auto;
}

.wsc-stat-value,
#scorev,
#timer {
    display: inline-block;
    margin-left: 6px;
    font-size: 1.15rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #fef08a !important;
    text-shadow: 0 0 20px rgba(250, 204, 21, 0.18);
}

.wsc-answer#answer,
#answer.wsc-answer {
    float: none;
    flex: 1 1 200px;
    min-width: 120px;
    /* Fixed slot so header + game area height stay stable when hint appears */
    height: 6.75rem;
    min-height: 6.75rem;
    max-height: 6.75rem;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 6px;
    box-sizing: border-box;

    border-radius: 10px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px dashed rgba(148, 163, 184, 0.25);
}

/* Reserve vertical space below label when no hint text yet */
#answer.wsc-answer:empty::after {
    content: '';
    flex: 1 1 auto;
    min-height: 0;
}

.wsc-answer#answer.wsc-answer--hint,
#answer.wsc-answer.wsc-answer--hint {
    border-style: solid;
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(30, 41, 59, 0.65);
}

#answer.wsc-answer::before {
    content: 'Hint';
    flex: 0 0 auto;
    width: 100%;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #fca5a5;
    text-align: center;
    line-height: 1.2;
    opacity: 0.38;
}

#answer.wsc-answer.wsc-answer--hint::before {
    opacity: 1;
}

#answer span,
#answer .wsc-hint-text {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 8px 10px;
    box-sizing: border-box;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #fecaca !important;
    background: rgba(127, 29, 29, 0.35) !important;
    border: 1px solid rgba(248, 113, 113, 0.4) !important;
    border-radius: 6px;
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: anywhere;
    text-align: center;
    overflow-y: auto;
}

.wsc-main#game-container,
#game-container.wsc-main {
    float: none;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 20px 14px 28px;
    box-sizing: border-box;
    font-size: 1rem;
}

.wsc-grid#grid-container,
#grid-container.wsc-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-start;
    align-items: flex-start;
    gap: 26px 12px;
    margin: 10px auto 16px;
    padding: 22px 18px 26px;
    min-height: 180px;
    height: auto;
    max-width: 100%;

    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(51, 65, 85, 0.6);
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.wsc-gw .grid-item {
    flex: 0 0 68px;
    width: 68px;
    height: 68px;
    margin: 0;

    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;

    font-size: clamp(1.25rem, 4vw, 1.85rem);
    font-weight: 800;
    color: #f8fafc;

    border: 1px solid rgba(34, 211, 238, 0.25);
    border-radius: 10px;
    cursor: pointer;
    user-select: none;

    background: linear-gradient(165deg, #475569 0%, #334155 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.2);

    transition: transform 0.1s ease, filter 0.12s ease;
}

.wsc-gw .grid-item:hover {
    filter: brightness(1.08);
    border-color: rgba(34, 211, 238, 0.45);
}

.wsc-gw .grid-item:active {
    transform: scale(0.95);
}

.wsc-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    margin-top: 56px;
}

.wsc-input#word-input,
#word-input.wsc-input {
    box-sizing: border-box;
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 0;
    padding: 12px 14px;
    height: auto;
    min-height: 48px;

    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #f1f5f9;

    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(100, 116, 139, 0.45);
    border-radius: 10px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.wsc-input::placeholder {
    color: #64748b;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 500;
}

.wsc-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.wsc-gw .wsc-btn {
    appearance: none;
    margin: 0;
    padding: 10px 18px;
    font-size: 0.75rem;
    font-weight: 800;
    font-family: inherit;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: filter 0.12s ease, transform 0.1s ease;
}

.wsc-btn--primary#submit-button {
    color: #0f172a;
    border-color: rgba(34, 211, 238, 0.5);
    background: linear-gradient(180deg, #5eead4 0%, #22d3ee 100%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 6px 18px rgba(34, 211, 238, 0.15);
}

.wsc-btn--secondary#next-button {
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.45);
    background: rgba(51, 65, 85, 0.9);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.wsc-btn--ghost#view-button {
    color: #7dd3fc;
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(15, 23, 42, 0.5);
}

.wsc-btn:hover {
    filter: brightness(1.06);
}

.wsc-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.3);
}

.wsc-btn:disabled:active {
    transform: none;
}

.wsc-gameover#gameover,
#gameover.wsc-gameover {
    display: none;
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    margin: 0;
    z-index: 20;

    padding: 32px 20px 24px;
    box-sizing: border-box;

    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;

    background: rgba(8, 10, 14, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 14px;
}

#gameover.wsc-gameover .msg,
#gameover .msg.wsc-gameover-title {
    float: none;
    width: auto;
    margin: 0;
    padding: 0;

    font-family: inherit;
    font-size: clamp(1.4rem, 4vw, 1.85rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #f8fafc !important;
}

.wsc-ov-btn {
    appearance: none;
    display: block;
    width: 100%;
    max-width: 240px;
    margin: 0;
    padding: 12px 18px;

    font-size: 0.8rem;
    font-weight: 800;
    font-family: inherit;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;

    color: #0f172a;
    border: 1px solid rgba(34, 211, 238, 0.45);
    border-radius: 10px;
    background: linear-gradient(180deg, #5eead4 0%, #22d3ee 100%);
    box-shadow: 0 4px 16px rgba(34, 211, 238, 0.2);
    transition: filter 0.12s ease, transform 0.1s ease;
}

.wsc-ov-btn--muted#resetbtn {
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.4);
    background: rgba(51, 65, 85, 0.85);
    box-shadow: none;
}

.wsc-ov-btn:hover {
    filter: brightness(1.05);
}

.wsc-ov-btn:active {
    transform: translateY(1px);
}

#score-container {
    margin-top: 20px;
}

@media (max-width: 520px) {
    .wsc-header#header {
        flex-direction: column;
        align-items: stretch;
    }

    .wsc-stat--time {
        margin-left: 0;
        text-align: center;
    }

    .wsc-stat {
        text-align: center;
    }

    .wsc-grid#grid-container {
        gap: 22px 10px;
        padding: 20px 14px 24px;
    }

    .wsc-gw .grid-item {
        flex: 0 0 54px;
        width: 54px;
        height: 54px;
        font-size: 1.35rem;
    }
}

/* Game Worlds: same play column height as sky-shooter.css #gamebox */
.game-worlds-play-shell #gamebox.wsc-gw {
    flex: 0 0 auto;
    height: calc(768px * 5 / 7);
    max-height: calc(768px * 5 / 7);
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.game-worlds-play-shell #gamebox.wsc-gw .wsc-header {
    flex-shrink: 0;
}

.game-worlds-play-shell #gamebox.wsc-gw .wsc-main {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}
