:root {
    color-scheme: dark;
    --bg: #11101a;
    --panel: rgba(34, 31, 49, 0.88);
    --panel-strong: #242132;
    --line: rgba(255, 255, 255, 0.1);
    --text: #f8f5ff;
    --muted: rgba(248, 245, 255, 0.62);
    --gold: #ffd75e;
    --gold-deep: #f0a828;
    --violet: #a783ff;
    --teal: #62e2c3;
    --danger: #ff7f96;
    --safe-top: max(10px, env(safe-area-inset-top, 0px));
    --safe-bottom: max(14px, env(safe-area-inset-bottom, 0px));
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-width: 280px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: var(--safe-top) max(10px, env(safe-area-inset-right, 0px)) var(--safe-bottom) max(10px, env(safe-area-inset-left, 0px));
    overflow-x: hidden;
    background:
        radial-gradient(circle at 14% 5%, rgba(157, 112, 255, 0.22), transparent 30rem),
        radial-gradient(circle at 88% 44%, rgba(68, 211, 178, 0.14), transparent 28rem),
        linear-gradient(150deg, #171522 0%, #100f18 58%, #17131c 100%);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
summary {
    font: inherit;
    -webkit-tap-highlight-color: transparent;
}

button {
    color: inherit;
}

.ambient {
    position: fixed;
    z-index: -1;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.28;
    pointer-events: none;
}

.ambient-one {
    top: 14%;
    left: -120px;
    background: #8e67ff;
}

.ambient-two {
    right: -120px;
    bottom: 8%;
    background: #2bbca1;
}

.user-bar {
    position: relative;
    z-index: 20;
    width: min(100%, 980px);
    margin: 0 auto 14px;
}

.wordluck-app {
    width: min(100%, 980px);
    margin: 0 auto;
}

.brand-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    padding: 0 4px;
}

.brand-copy {
    min-width: 0;
}

.kicker,
.eyebrow {
    margin: 0;
    color: var(--teal);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.brand-copy h1 {
    margin: 1px 0 3px;
    font-size: clamp(34px, 8vw, 52px);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.brand-copy h1 span {
    background: linear-gradient(135deg, #fff0a0, var(--gold-deep));
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.brand-copy > p:last-child {
    max-width: 570px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.sound-toggle {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.065);
    color: var(--gold);
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.sound-toggle:active,
.action-btn:active,
.round-btn:active,
.key:active,
.modal-primary:active,
.modal-secondary:active {
    transform: scale(0.97);
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.stat {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.055);
    box-shadow: 0 9px 28px rgba(0, 0, 0, 0.14);
    backdrop-filter: blur(14px);
}

.stat span {
    display: block;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.stat strong {
    display: block;
    margin-top: 1px;
    overflow: hidden;
    font-size: clamp(20px, 6vw, 28px);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.035em;
    line-height: 1.05;
    text-overflow: ellipsis;
}

.stat-accent {
    border-color: rgba(255, 215, 94, 0.26);
    background: linear-gradient(140deg, rgba(255, 215, 94, 0.11), rgba(255, 168, 37, 0.035));
}

.stat-accent strong {
    color: var(--gold);
}

.stat.is-danger strong {
    color: var(--danger);
    animation: timerPulse 0.7s ease-in-out infinite alternate;
}

@keyframes timerPulse {
    to { opacity: 0.58; transform: scale(0.96); }
}

.game-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(250px, 0.75fr);
    gap: 12px;
    align-items: start;
}

.play-card,
.side-card,
.rules-card {
    border: 1px solid var(--line);
    background: linear-gradient(145deg, rgba(40, 36, 56, 0.94), rgba(28, 26, 41, 0.94));
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(16px);
}

.play-card {
    min-width: 0;
    border-radius: 22px;
    padding: clamp(12px, 3vw, 18px);
}

.turn-head,
.side-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.turn-head > div {
    display: flex;
    align-items: center;
    min-width: 0;
}

.turn-head strong {
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.phase-dot {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 14px rgba(98, 226, 195, 0.8);
}

.phase-dot.is-letter {
    background: var(--gold);
    box-shadow: 0 0 14px rgba(255, 215, 94, 0.78);
}

.phase-dot.is-word {
    background: var(--violet);
    box-shadow: 0 0 14px rgba(167, 131, 255, 0.8);
}

.daily-pill,
.live-pill {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 5px 8px;
    background: rgba(255, 215, 94, 0.12);
    color: var(--gold);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.phase-help {
    min-height: 19px;
    margin: 5px 0 12px 17px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.board-shell {
    position: relative;
    width: min(100%, 540px);
    margin: 0 auto;
    padding: clamp(8px, 2.5vw, 14px);
    overflow: hidden;
    border: 1px solid rgba(255, 215, 94, 0.13);
    border-radius: 23px;
    background:
        radial-gradient(circle at 50% 35%, rgba(168, 127, 255, 0.16), transparent 54%),
        linear-gradient(145deg, rgba(15, 14, 24, 0.95), rgba(24, 20, 30, 0.98));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025), inset 0 -22px 60px rgba(0, 0, 0, 0.18);
}

.board {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: repeat(5, minmax(0, 1fr));
    gap: clamp(5px, 1.8vw, 9px);
    width: 100%;
    aspect-ratio: 1;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.cell {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 0;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: clamp(10px, 3vw, 16px);
    background: rgba(255, 255, 255, 0.035);
    color: rgba(255, 255, 255, 0.16);
    font-size: clamp(22px, 8vw, 38px);
    font-weight: 850;
    line-height: 1;
    cursor: default;
    transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.cell:disabled {
    opacity: 1;
}

.cell.is-filled {
    border-color: rgba(255, 255, 255, 0.13);
    background: linear-gradient(145deg, #f8f4ff, #cfc5e6);
    color: #211c2d;
    cursor: pointer;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.3), inset 0 1px 0 #fff;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.cell.is-available {
    border: 1.5px dashed rgba(98, 226, 195, 0.68);
    background: rgba(98, 226, 195, 0.065);
    color: transparent;
    cursor: pointer;
    box-shadow: inset 0 0 18px rgba(98, 226, 195, 0.05);
}

.cell.is-available::after {
    content: "+";
    color: rgba(98, 226, 195, 0.7);
    font-size: clamp(19px, 6vw, 27px);
    font-weight: 350;
}

.cell.is-available:hover,
.cell.is-available:focus-visible {
    border-style: solid;
    background: rgba(98, 226, 195, 0.14);
    transform: translateY(-2px);
}

.cell.is-new {
    z-index: 4;
    border-color: rgba(255, 215, 94, 0.9);
    background: linear-gradient(145deg, #fff0a0, #f6b433);
    box-shadow: 0 0 0 3px rgba(255, 215, 94, 0.16), 0 9px 24px rgba(242, 170, 38, 0.28);
    animation: letterPop 0.28s cubic-bezier(0.22, 1.35, 0.36, 1) both;
}

.cell.is-target {
    border-style: solid;
    border-color: rgba(255, 215, 94, 0.9);
    background: rgba(255, 215, 94, 0.14);
    color: transparent;
    box-shadow: inset 0 0 24px rgba(255, 215, 94, 0.1), 0 0 0 3px rgba(255, 215, 94, 0.1);
}

.cell.is-target::after {
    color: var(--gold);
}

.cell.is-selected {
    z-index: 5;
    border-color: rgba(169, 133, 255, 0.95);
    background: linear-gradient(145deg, #cbb8ff, #9570ed);
    color: #181222;
    transform: scale(1.055);
    box-shadow: 0 0 0 3px rgba(167, 131, 255, 0.2), 0 8px 22px rgba(104, 67, 190, 0.34);
}

.cell.is-selected::before {
    content: attr(data-step);
    position: absolute;
    top: 4px;
    left: 5px;
    color: rgba(27, 18, 43, 0.62);
    font-size: 9px;
    font-weight: 900;
}

@keyframes letterPop {
    from { opacity: 0.45; transform: scale(0.62) rotate(-6deg); }
    70% { transform: scale(1.09) rotate(1deg); }
    to { opacity: 1; transform: scale(1); }
}

.cell.is-accepted {
    animation: acceptedPop 0.38s cubic-bezier(0.2, 1.6, 0.3, 1) both;
}

@keyframes acceptedPop {
    45% { transform: translateY(-3px) scale(1.08); filter: brightness(1.15); }
}

.word-trail {
    position: absolute;
    z-index: 2;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.word-trail polyline {
    fill: none;
    stroke: rgba(167, 131, 255, 0.9);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 5;
    filter: drop-shadow(0 0 5px rgba(132, 90, 235, 0.8));
}

.board-glow {
    position: absolute;
    z-index: 7;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255, 224, 109, 0.24), transparent 66%);
}

.board-glow.is-live {
    animation: boardFlash 0.6s ease-out;
}

@keyframes boardFlash {
    30% { opacity: 1; }
    to { opacity: 0; }
}

.word-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    margin: 9px 0 7px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(10, 9, 16, 0.24);
}

.word-preview span {
    max-width: 74%;
    overflow: hidden;
    color: var(--muted);
    font-size: 15px;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.word-preview.has-word span {
    color: var(--text);
    font-size: 20px;
}

.word-preview b {
    color: var(--gold);
    font-size: 13px;
}

.move-actions,
.round-actions {
    display: grid;
    grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
    gap: 8px;
}

.action-btn,
.round-btn,
.modal-primary,
.modal-secondary {
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.065);
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.16s ease, opacity 0.16s ease, background 0.16s ease;
}

.action-primary,
.modal-primary {
    border-color: rgba(255, 215, 94, 0.24);
    background: linear-gradient(135deg, #ffe37a, #eea826);
    color: #3b2800;
    box-shadow: 0 8px 20px rgba(238, 168, 38, 0.2);
}

.action-btn:disabled,
.round-btn:disabled {
    cursor: default;
    opacity: 0.38;
}

.keyboard[hidden] {
    display: none;
}

.keyboard {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 9px;
    padding: 8px 5px;
    border: 1px solid rgba(255, 215, 94, 0.13);
    border-radius: 15px;
    background: rgba(13, 12, 20, 0.35);
    animation: keyboardIn 0.18s ease-out both;
}

@keyframes keyboardIn {
    from { opacity: 0; transform: translateY(6px); }
}

.key-row {
    display: flex;
    justify-content: center;
    gap: clamp(2px, 0.9vw, 5px);
}

.key {
    flex: 1 1 0;
    max-width: 42px;
    min-width: 0;
    min-height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 8px;
    padding: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
    color: var(--text);
    font-size: clamp(12px, 3.8vw, 16px);
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.2);
}

.key:hover,
.key:focus-visible {
    border-color: rgba(255, 215, 94, 0.5);
    background: rgba(255, 215, 94, 0.13);
}

.round-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 8px;
}

.round-btn {
    min-width: 0;
    min-height: 44px;
    padding: 8px 5px;
    color: var(--muted);
    font-size: 11px;
}

.round-btn span {
    color: var(--gold);
}

.side-column {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.side-card,
.rules-card {
    border-radius: 18px;
    padding: 15px;
}

.side-heading h2 {
    margin: 2px 0 0;
    font-size: 19px;
    line-height: 1.18;
}

.best-card {
    overflow: hidden;
    background:
        radial-gradient(circle at 88% 18%, rgba(255, 215, 94, 0.2), transparent 44%),
        linear-gradient(145deg, rgba(47, 39, 54, 0.96), rgba(29, 26, 41, 0.96));
}

.best-card .eyebrow {
    color: var(--gold);
}

.best-card p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.best-crown {
    color: var(--gold);
    font-size: 38px;
    line-height: 1;
    filter: drop-shadow(0 6px 14px rgba(255, 192, 48, 0.28));
}

.live-pill {
    background: rgba(98, 226, 195, 0.1);
    color: var(--teal);
}

.word-list {
    display: grid;
    gap: 7px;
    max-height: 285px;
    margin: 12px 0 0;
    padding: 0;
    overflow: auto;
    list-style: none;
}

.word-list li:not(.empty-history) {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    min-height: 39px;
    padding: 7px 9px;
    border: 1px solid rgba(255, 255, 255, 0.065);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.04);
    animation: historyIn 0.28s ease-out both;
}

@keyframes historyIn {
    from { opacity: 0; transform: translateY(-7px); }
}

.word-list .move-number {
    color: rgba(255, 255, 255, 0.32);
    font-size: 10px;
    font-weight: 800;
}

.word-list strong {
    overflow: hidden;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-overflow: ellipsis;
    text-transform: uppercase;
}

.word-list b {
    color: var(--gold);
    font-size: 12px;
}

.empty-history {
    padding: 16px 4px 4px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.rules-card {
    padding: 0;
    overflow: hidden;
}

.rules-card summary {
    min-height: 50px;
    padding: 15px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    list-style: none;
}

.rules-card summary::-webkit-details-marker {
    display: none;
}

.rules-card summary::after {
    content: "+";
    float: right;
    color: var(--gold);
    font-size: 18px;
}

.rules-card[open] summary::after {
    content: "−";
}

.rules-card > div {
    padding: 0 15px 14px;
}

.rules-card p {
    margin: 0 0 9px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.rules-card p:last-child {
    margin-bottom: 0;
}

.rules-card b {
    color: var(--text);
}

.toast {
    position: fixed;
    z-index: 90;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    width: max-content;
    max-width: calc(100vw - 28px);
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    opacity: 0;
    background: rgba(26, 23, 37, 0.96);
    box-shadow: 0 13px 35px rgba(0, 0, 0, 0.38);
    color: var(--text);
    font-size: 12px;
    font-weight: 750;
    text-align: center;
    transform: translate(-50%, 18px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.toast.error {
    border-color: rgba(255, 127, 150, 0.34);
    color: #ffb1bf;
}

.result-modal[hidden] {
    display: none;
}

.result-modal {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 7, 13, 0.78);
    backdrop-filter: blur(7px);
}

.result-card {
    position: relative;
    width: min(100%, 390px);
    border: 1px solid rgba(255, 215, 94, 0.18);
    border-radius: 24px;
    padding: 22px;
    background:
        radial-gradient(circle at 50% 4%, rgba(255, 215, 94, 0.15), transparent 45%),
        linear-gradient(145deg, #2c283b, #1c1a28);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    text-align: center;
    animation: resultIn 0.32s cubic-bezier(0.22, 1.2, 0.36, 1) both;
}

@keyframes resultIn {
    from { opacity: 0; transform: translateY(18px) scale(0.95); }
}

.result-mark {
    display: grid;
    width: 66px;
    height: 66px;
    margin: 0 auto 12px;
    place-items: center;
    border: 1px solid rgba(255, 215, 94, 0.38);
    border-radius: 19px;
    background: linear-gradient(145deg, #ffe683, #e99c1c);
    box-shadow: 0 12px 32px rgba(235, 157, 29, 0.26);
    color: #422c00;
    font-size: 23px;
    font-weight: 950;
    letter-spacing: -0.06em;
    transform: rotate(-4deg);
}

.result-card .eyebrow {
    color: var(--gold);
}

.result-card h2 {
    margin: 4px 0 5px;
    font-size: 27px;
}

.result-card > p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.result-score {
    display: grid;
    margin: 16px 0 10px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(8, 7, 13, 0.25);
}

.result-score span,
.result-score small {
    color: var(--muted);
    font-size: 11px;
}

.result-score strong {
    color: var(--gold);
    font-size: 39px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.05em;
    line-height: 1.08;
}

.submit-status {
    min-height: 18px;
    margin-bottom: 12px !important;
    font-size: 11px !important;
}

.modal-primary,
.modal-secondary {
    width: 100%;
    margin-top: 8px;
}

.modal-secondary {
    background: rgba(255, 255, 255, 0.065);
}

.score-float {
    position: fixed;
    z-index: 80;
    color: var(--gold);
    font-size: 18px;
    font-weight: 900;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    animation: scoreFloat 0.85s ease-out both;
    pointer-events: none;
}

@keyframes scoreFloat {
    from { opacity: 0; transform: translate(-50%, 8px) scale(0.72); }
    28% { opacity: 1; transform: translate(-50%, -6px) scale(1.12); }
    to { opacity: 0; transform: translate(-50%, -48px) scale(0.94); }
}

button:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(255, 215, 94, 0.68);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Portrait game surface, using the shared Luck4Luck palette and glass panels. */
:root { --bg: #15131f; --gold: #ffd980; --gold-deep: #eead48; --violet: #ba8cff; }
body {
    background: radial-gradient(circle at 20% 0%, rgba(186,104,200,.25), transparent 50%),
        radial-gradient(circle at 80% 100%, rgba(77,182,172,.22), transparent 50%),
        linear-gradient(135deg, #15131f 0%, #1c1a2b 60%, #1a1a2e 100%);
}
.user-bar, .wordluck-app { width: min(100%, 460px); }
.user-bar { margin-bottom: 10px; }
.brand-row { align-items: center; margin-bottom: 10px; gap: 8px; }
.brand-copy h1 { font-size: 28px; line-height: 1.1; margin: 3px 0 0; }
.kicker { font-size: 8px; color: var(--muted); letter-spacing: .1em; }
.sound-toggle { border-radius: 12px; box-shadow: none; }
.stats { gap: 6px; margin-bottom: 8px; }
.stat { padding: 8px 10px; border-radius: 12px; box-shadow: none; backdrop-filter: none; }
.stat strong { font-size: 23px; line-height: 1.15; }
.stat span { font-size: 9px; }
.game-layout { display: flex; flex-direction: column; gap: 10px; }
.play-card { width: 100%; padding: 10px; border-radius: 18px; }
.play-card, .rules-card { background: rgba(255,255,255,.035); box-shadow: none; backdrop-filter: none; }
.turn-head { gap: 6px; }
.turn-head strong { font-size: 13px; }
.daily-pill { font-size: 8px; padding: 5px 6px; letter-spacing: 0; }
.phase-help { margin: 5px 0 9px; min-height: 28px; font-size: 11px; line-height: 1.3; }
.board-shell { max-width: min(100%, 40dvh); min-width: min(100%, 252px); padding: 6px; border-radius: 16px; }
.board { gap: 5px; }
.cell { border-radius: 10px; font-size: clamp(22px, 6vw, 30px); }
.cell.is-filled { background: linear-gradient(145deg, #39334e, #292438); color: #faf7ff; text-shadow: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 3px 6px rgba(0,0,0,.2); }
.cell.is-new { background: linear-gradient(135deg, #ffe49a, #eead48); color: #362607; }
.cell.is-selected { background: linear-gradient(135deg, #d0adff, #9d73e0); color: #241638; }
.word-preview { min-height: 40px; margin: 8px 0; border-radius: 10px; }
.word-preview span { font-size: 12px; }
.action-btn { min-height: 44px; border-radius: 11px; }
.action-primary, .modal-primary { background: linear-gradient(135deg, #ffe49a, #eead48); }
.round-actions { margin-top: 6px; gap: 5px; }
.round-btn { font-size: 10px; border: 0; background: transparent; }
.side-column { width: 100%; gap: 8px; }
.record-strip { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 8px; font-size: 12px; color: var(--muted); }
.record-strip strong { color: var(--gold); }
.rules-card { border-radius: 12px; }
.rules-card summary { min-height: 44px; padding: 12px; font-size: 12px; }
.word-list { max-height: 200px; margin: 0; padding: 0 12px 12px; }
.keyboard { display: grid; grid-template-columns: repeat(9,minmax(0,1fr)); gap: 4px; padding: 6px; margin: 8px 0; animation: none; }
.key-row { display: contents; }
.key { max-width: none; min-height: 44px; font-size: 15px; box-shadow: none; }
.play-card:has(.keyboard:not([hidden])) .word-preview,
.play-card:has(.keyboard:not([hidden])) .round-actions,
.play-card:has(.keyboard:not([hidden])) #acceptBtn { display: none; }
.play-card:has(.keyboard:not([hidden])) .move-actions { grid-template-columns: 1fr; }
.play-card:has(.keyboard:not([hidden])) .board-shell { max-width: 252px; }
.result-card { max-height: calc(100dvh - 40px); overflow-y: auto; }
@media (max-width: 350px) {
    body { padding-left: max(6px,env(safe-area-inset-left)); padding-right: max(6px,env(safe-area-inset-right)); }
    .play-card { padding: 8px; }
    .brand-copy h1 { font-size: 25px; }
    .daily-pill { font-size: 7px; }
}
@media (max-height: 700px) {
    .brand-row { margin-bottom: 6px; }
    .phase-help { min-height: 0; }
    .board-shell { max-width: 252px; }
    .stat { padding: 5px 8px; }
}

.wordluck-app[data-phase="place"] .word-preview,
.wordluck-app[data-phase="place"] .move-actions,
.wordluck-app[data-phase="spell"] .round-actions { display: none; }
@media (max-height: 700px) {
    .wordluck-app[data-phase="spell"] .brand-row { display: none; }
    .play-card { padding-top: 8px; padding-bottom: 4px; }
}
