.faws-game{box-sizing:border-box;width:100%;max-width:1300px;margin:0 auto;padding:clamp(10px,2vw,24px);container-type:inline-size;border-radius:22px;border:1px solid #ddc6ee;background:radial-gradient(ellipse at 50% 0,#fff,#efe5f8 80%);box-shadow:0 12px 34px #3017471f;color:#35204e;font-family:inherit}
.faws-heading{padding:clamp(14px,4vw,24px);border-radius:16px;background:#542782;color:#fff}
.faws-heading h2{color:inherit;margin:6px 0;font-size:clamp(22px,5vw,36px)}
.faws-heading p{margin:8px 0;font-size:15px;line-height:1.65}
.faws-heading span,.faws-date{font-size:13px;color:#efe0ff}
.faws-stats { display: grid; justify-items: start; gap: 8px; font-size: 14px; }
.faws-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: 100%; }
.faws-metric {
    display: grid;
    gap: 3px;
    padding: 6px 4px;
    text-align: center;
    border: 1px solid #dec5f1;
    border-radius: 9px;
    background: #eee0fa;
    color: #462168;
    line-height: 1.25;
}
.faws-metric-time { background: #fff0cf; border-color: #efd69d; color: #61400e; }
.faws-metric > span { font-size: 12px; font-weight: 700; }
.faws-metric svg { width: 14px; height: 14px; vertical-align: -2px; }
.faws-metric strong { font-size: clamp(16px, 2.2cqi, 22px); font-variant-numeric: tabular-nums; }
.faws-word-progress {
    display: block;
    width: 100%;
    height: 6px;
    border: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #e9daf5;
    accent-color: #69359e;
    appearance: none;
}
.faws-word-progress::-webkit-progress-bar { background: #e9daf5; }
.faws-word-progress::-webkit-progress-value { background: #69359e; }
.faws-word-progress::-moz-progress-bar { background: #69359e; }
.faws-game .faws-reset{background:#542782;color:#fff;border:0;border-radius:8px;padding:8px 10px;min-height:44px;font:inherit;cursor:pointer}
.faws-board{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:clamp(2px,.8vw,6px);width:100%;max-width:512px;margin:auto;touch-action:none;user-select:none}
.faws-game .faws-board button{appearance:none;display:grid;place-items:center;box-sizing:border-box;width:100%;min-width:0;min-height:0;aspect-ratio:1;padding:0;border:1px solid #ddc6ee;border-radius:6px;background:#fff;color:#402361;font-family:inherit;font-size:clamp(12px,4.25vw,25px);font-weight:700;line-height:1;cursor:pointer}
.faws-game .faws-board .faws-found{background:#d8efdf;color:#164328;border-color:#5f9d71}
.faws-game .faws-board .faws-selected{background:#f8df9a;color:#492e0e;border-color:#ab7000}
.faws-board button:focus-visible,.faws-reset:focus-visible{outline:2px solid #492171;outline-offset:1px;z-index:1}
.faws-message{min-height:1.5em;margin:10px 0;color:#542782;text-align:center}
.faws-game h3{color:inherit;margin:10px 0}
.faws-clues{padding-inline-start:24px;margin:0;display:grid;gap:8px;line-height:1.55}
.faws-clues li strong{display:block;color:#196033}
.faws-clues li strong:empty{display:none}

/* Keep the FirstAudio page shell and widen the game article. */
main.fa-single:has(.faws-game) {
    width: min(calc(100% - 24px), 1300px);
    max-width: 1300px;
    margin-inline: auto;
    padding-block: 16px;
}
main.fa-single:has(.faws-game) > article > :is(.fa-back, .fa-article-head, .fa-article-image) {
    display: none;
}

.faws-layout {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    grid-template-areas: "title" "board" "side";
}

.faws-heading {
    background: radial-gradient(ellipse at 50% 0, #7143a0, #311754 75%);
    border: 1px solid #af8158;
    box-shadow: inset 0 0 0 2px #593a77;
}
.faws-game .faws-heading h2 {
    grid-area: 2 / 1 / auto / -1;
    margin: 0;
    color: #ffe4a0;
    font-size: clamp(18px, 2.25cqi, 28px);
    line-height: 1.35;
}
.faws-game .faws-heading > span { text-align: start; }
.faws-game .faws-date { text-align: end; }
.faws-game .faws-heading > :is(span, time) { font-size: 11px; }
.faws-heading span, .faws-date { color: #ffe5b7; }


.faws-game .faws-heading {
    grid-area: title;
    text-align: center;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 10px;
    padding: 10px 14px;
    line-height: 1.3;
    box-shadow: inset 0 0 0 3px #311754, inset 0 0 0 4px #b7864e, 0 5px 14px #30174740;
}
.faws-board-frame {
    grid-area: board;
    min-width: 0;
    padding: clamp(5px, 1vw, 12px);
    border-radius: 10px;
    background: linear-gradient(145deg, #9169be, #2c163f 80%);
    box-shadow: 0 8px 16px #30174745;
}
.faws-board {
    max-width: none;
    gap: 1px;
    container-type: inline-size;
    border-radius: 4px;
    overflow: hidden;
    background: #986fbd;
}
.faws-game .faws-board button {
    padding: 2px;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #fbf0dc;
    font-size: clamp(10px, 3.2vw, 23px);
    font-size: clamp(10px, 3.8cqi, 28px);
    line-height: 1.2;
}
.faws-game .faws-board button:nth-child(16n + 1),
.faws-game .faws-board button:nth-child(16n + 3),
.faws-game .faws-board button:nth-child(16n + 5),
.faws-game .faws-board button:nth-child(16n + 7),
.faws-game .faws-board button:nth-child(16n + 10),
.faws-game .faws-board button:nth-child(16n + 12),
.faws-game .faws-board button:nth-child(16n + 14),
.faws-game .faws-board button:nth-child(16n + 16) { background: #ead9f5; }
.faws-game .faws-board button.faws-found { background: #ccead6; }
.faws-game .faws-board button.faws-selected { background: #f8df9a; }
.faws-game .faws-board button:focus-visible { outline-offset: -3px; }
.faws-side { grid-area: side; display: grid; gap: 14px; min-width: 0; }
.faws-progress, .faws-clue-panel {
    min-width: 0;
    padding: clamp(12px, 1.5vw, 20px);
    border-radius: 12px;
    overflow-wrap: anywhere;
}
.faws-progress {
    background: #fbf7ff;
    border: 1px solid #dec5f1;
    box-shadow: 0 5px 0 #d4bce8, 0 8px 16px #3017471c;
}
.faws-clue-panel { background: linear-gradient(150deg, #f6effd, #e8d9f6); }
.faws-stats { margin: 0; }
.faws-guide summary { cursor: pointer; font-weight: 700; }
.faws-guide p { margin: 8px 0 0; line-height: 1.65; }

@container (min-width: 850px) {
    .faws-layout {
        grid-template-columns: minmax(0, 52fr) minmax(0, 48fr);
        grid-template-rows: auto 1fr;
        grid-template-areas: "board title" "board side";
    }
    .faws-side {
        align-self: stretch;
        grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
    }
    .faws-progress { box-shadow: inset 0 -3px #e3d1ef; }
    .faws-game .faws-clue-panel h3 { margin: 0 0 8px; font-size: 16px; line-height: 1.4; }
    .faws-clues, .faws-guide { font-size: 14px; }
    .faws-message:empty { display: none; }
    .faws-guide { margin-top: 10px; }
    .faws-guide p { line-height: 1.45; }
    .faws-clues { gap: 6px; line-height: 1.4; }
    .faws-game .faws-progress > .faws-invite,
    .faws-game .faws-progress > .firstaudio-word-search-audio-row {
        vertical-align: middle;
        margin-block: 10px 0;
    }
    .faws-game .faws-progress > .faws-invite {
        box-sizing: border-box;
        padding: 6px 10px;
    }
    .faws-game .faws-progress > .firstaudio-word-search-audio-row {
        display: inline-flex;
        margin-inline-start: 6px;
        padding: 0;
    }
    .faws-game .firstaudio-word-search-audio-row > button.firstaudio-audio-toggle {
        width: 44px;
        height: 44px;
    }
}

.faws-game .faws-invite {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-top: 14px;
    padding: 6px 14px;
    background: #542782;
    color: #fff;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
}
.faws-invite:focus-visible { outline: 2px solid #492171; outline-offset: 2px; }
.faws-share-url { box-sizing: border-box; width: 100%; margin-top: 8px; }
.faws-share-status { margin: 8px 0 0; }
.faws-share-status:empty { display: none; }

.faws-share-dialog {
    box-sizing: border-box;
    width: min(440px, calc(100% - 32px));
    max-height: calc(100% - 32px);
    padding: 24px;
    border: 1px solid #dec5f1;
    border-radius: 14px;
    background: #fbf7ff;
    color: #341c50;
}
.faws-share-dialog::backdrop { background: #21113399; }
.faws-share-dialog h3 { margin: 0 0 12px; }
.faws-share-dialog .faws-share-close { float: right; }
.faws-share-dialog .faws-share-close,
.faws-share-dialog .faws-share-copy {
    min-height: 44px;
    padding: 8px 14px;
    border: 0;
    border-radius: 8px;
    background: #542782;
    color: #fff;
    font: inherit;
    cursor: pointer;
}
.faws-share-dialog .faws-share-copy { margin-top: 12px; }
.faws-share-dialog .faws-share-url { min-height: 44px; padding: 8px; }
