#game-root .cr-shell {
    --ink: #f1ece0;
    --brass: #f2c14e;
    --slate: #1b2d35;
    box-sizing: border-box;
    position: relative;
    width: min(100%, 980px);
    margin: 0 auto;
    padding: clamp(8px, 1.6vw, 16px);
    border: 1px solid #2f4a55;
    border-radius: 16px;
    background: radial-gradient(120% 90% at 50% 0%, #34545f 0%, #1d333c 58%, #142329 100%);
    box-shadow: var(--cg-shadow, 0 14px 40px rgba(14, 28, 33, 0.28));
    color: var(--ink);
    font-family: Inter, Arial, sans-serif;
}

#game-root .cr-shell *,
#game-root .cr-shell *::before,
#game-root .cr-shell *::after { box-sizing: border-box; }

#game-root .cr-shell [hidden] { display: none !important; }

#game-root .cr-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

#game-root .cr-stats,
#game-root .cr-actions { display: flex; align-items: center; gap: 6px; min-width: 0; }

#game-root .cr-stat {
    min-width: 52px;
    padding: 3px 9px;
    border: 1px solid rgba(240, 233, 214, 0.16);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.06);
    text-align: center;
}

#game-root .cr-stat span {
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(241, 236, 224, 0.62);
}

#game-root .cr-stat strong { display: block; font-size: 16px; line-height: 1.2; }

#game-root .cr-icon,
#game-root .cr-btn,
#game-root .cr-seg-btn,
#game-root .cr-key {
    min-width: 44px;
    min-height: 44px;
    border: 1px solid rgba(240, 233, 214, 0.2);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
    color: var(--ink);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.28);
    transition: transform 90ms ease, background 120ms ease, box-shadow 90ms ease;
}

#game-root .cr-icon { font-size: 20px; line-height: 1; }
#game-root .cr-icon.cr-muted { opacity: 0.45; }

#game-root .cr-icon:active,
#game-root .cr-btn:active,
#game-root .cr-key:active,
#game-root .cr-seg-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.28); }

#game-root .cr-icon:focus-visible,
#game-root .cr-btn:focus-visible,
#game-root .cr-seg-btn:focus-visible,
#game-root .cr-key:focus-visible,
#game-root .cr-cell:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }

#game-root .cr-primary {
    border-color: #f7d58a;
    background: linear-gradient(180deg, #f6cf6a, #d99a26);
    color: #2a1c05;
    padding: 0 18px;
}

#game-root .cr-btn { padding: 0 16px; }
#game-root .cr-btn:disabled { opacity: 0.4; cursor: default; }

#game-root .cr-board {
    --s: 34px;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: clamp(260px, 46vh, 470px);
    padding: clamp(10px, 2vw, 22px);
    border-radius: 14px;
    border: 1px solid #8d7a52;
    background:
        radial-gradient(90% 70% at 50% 0%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 70%),
        repeating-linear-gradient(0deg, rgba(120, 90, 40, 0.035) 0 2px, transparent 2px 5px),
        linear-gradient(180deg, #f8f0dc, #eadcb8);
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.35), inset 0 -18px 30px rgba(120, 90, 40, 0.16), 0 8px 22px rgba(0, 0, 0, 0.35);
    color: #2a2418;
    overflow: hidden;
}

#game-root .cr-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b5a34;
}

#game-root .cr-bar {
    flex: 1;
    height: 8px;
    border-radius: 6px;
    background: rgba(90, 70, 30, 0.18);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

#game-root .cr-bar i {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #2f9a70, #7ad6a4);
    border-radius: 6px;
    transition: width 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

#game-root .cr-timer { font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }

#game-root .cr-quote {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    gap: calc(var(--s) * 0.42) calc(var(--s) * 0.55);
    padding: 10px 0;
}

#game-root .cr-word { display: flex; gap: max(2px, calc(var(--s) * 0.09)); }

#game-root .cr-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: var(--s);
    height: calc(var(--s) * 1.5);
    padding: calc(var(--s) * 0.06) 0 0;
    border: 1px solid #b8a575;
    border-bottom-width: 3px;
    border-radius: calc(var(--s) * 0.16);
    background: linear-gradient(180deg, #fffdf6, #f1e6c8);
    color: #2a2418;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(90, 70, 30, 0.25);
    transition: transform 110ms ease, box-shadow 110ms ease, background 140ms ease;
    -webkit-tap-highlight-color: transparent;
}

#game-root .cr-glyph {
    font-size: calc(var(--s) * 0.36);
    font-weight: 800;
    line-height: 1;
    color: #7a6a44;
    letter-spacing: 0.02em;
}

#game-root .cr-plain {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: calc(var(--s) * 0.72);
    font-weight: 700;
    line-height: 1;
    border-top: 2px solid rgba(90, 70, 30, 0.35);
    margin-top: calc(var(--s) * 0.05);
}

#game-root .cr-cell.cr-kin {
    background: linear-gradient(180deg, #e6f6f4, #bfe3e0);
    border-color: #4a9ea0;
}

#game-root .cr-cell.cr-sel {
    transform: translateY(-4px) scale(1.06);
    background: linear-gradient(180deg, #fff3c2, #f6d87a);
    border-color: #c98f1a;
    box-shadow: 0 0 0 3px rgba(242, 193, 78, 0.7), 0 8px 14px rgba(120, 80, 10, 0.35);
    z-index: 2;
}

#game-root .cr-cell.cr-sel .cr-plain { border-top-color: #c98f1a; animation: cr-blink 1s steps(2) infinite; }
#game-root .cr-cell.cr-sel .cr-plain:not(:empty) { animation: none; }

#game-root .cr-cell.cr-locked {
    background: linear-gradient(180deg, #e3f5e8, #b5e0c4);
    border-color: #3e9a68;
    color: #14563a;
}

#game-root .cr-cell.cr-locked .cr-glyph { color: #4d8a68; }

#game-root .cr-cell.cr-wrong {
    background: linear-gradient(180deg, #fde4df, #f3b4a8);
    border-color: #c4453a;
    color: #a12b20;
}

#game-root .cr-pop { animation: cr-pop 520ms cubic-bezier(0.2, 1.4, 0.4, 1); }
#game-root .cr-shake { animation: cr-shake 420ms ease; }
#game-root .cr-wave { animation: cr-wave 700ms ease both; }

@keyframes cr-blink { 50% { background: rgba(201, 143, 26, 0.18); } }
@keyframes cr-pop { 0% { transform: scale(1); } 40% { transform: scale(1.22) rotate(-3deg); } 100% { transform: scale(1); } }
@keyframes cr-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
@keyframes cr-wave { 0% { transform: translateY(0); } 40% { transform: translateY(-10px) scale(1.1); background: #fff3c2; } 100% { transform: translateY(0); } }

#game-root .cr-status {
    margin: 0;
    min-height: 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #5a4a26;
}

#game-root .cr-fx {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

#game-root .cr-pad { margin-top: 10px; }

#game-root .cr-keypad {
    display: grid;
    grid-template-columns: repeat(14, minmax(0, 1fr));
    gap: 5px;
}

#game-root .cr-key { padding: 0; min-width: 0; font-size: 16px; }
#game-root .cr-key.cr-used { opacity: 0.32; box-shadow: none; }
#game-root .cr-key-del { grid-column: span 1; }

#game-root .cr-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}

#game-root .cr-seg { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: rgba(0, 0, 0, 0.25); }
#game-root .cr-seg-btn { padding: 0 14px; box-shadow: none; background: transparent; border-color: transparent; color: rgba(241, 236, 224, 0.7); }
#game-root .cr-seg-btn[aria-pressed="true"] { background: rgba(242, 193, 78, 0.9); color: #2a1c05; }

#game-root .cr-result {
    margin-top: 10px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(242, 193, 78, 0.5);
    background: linear-gradient(180deg, rgba(242, 193, 78, 0.16), rgba(242, 193, 78, 0.05));
    text-align: center;
    animation: cr-rise 400ms ease both;
}

#game-root .cr-kicker { font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brass); }

#game-root .cr-tally { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
#game-root .cr-tally div { padding: 6px; border-radius: 10px; background: rgba(0, 0, 0, 0.22); }
#game-root .cr-tally span { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; color: rgba(241, 236, 224, 0.62); }
#game-root .cr-tally strong { font-size: 20px; }

#game-root .cr-result-actions { display: flex; justify-content: center; gap: 10px; }

@keyframes cr-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

#game-root .cr-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(8, 16, 20, 0.72);
}

#game-root .cr-modal-card {
    position: relative;
    width: min(100%, 460px);
    max-height: 90vh;
    overflow: auto;
    padding: 20px 20px 8px;
    border-radius: 16px;
    background: #1d333c;
    border: 1px solid #3c5a66;
    line-height: 1.45;
}

#game-root .cr-modal-card h2 { margin: 0 0 8px; font-size: 20px; }
#game-root .cr-modal-card p { margin: 0 0 12px; font-size: 14px; color: rgba(241, 236, 224, 0.88); }
#game-root .cr-close { position: absolute; top: 8px; right: 8px; }

@media (max-width: 720px) {
    #game-root .cr-keypad { grid-template-columns: repeat(7, minmax(0, 1fr)); }
    #game-root .cr-stat { min-width: 0; padding: 3px 7px; }
    #game-root .cr-tally strong { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
    #game-root .cr-cell, #game-root .cr-pop, #game-root .cr-shake, #game-root .cr-wave { animation: none !important; transition: none; }
}

.cg-shell-game .cg-stage-main #game-root > .cr-shell { max-width: min(100%, 880px) !important; }
