.khmw,
.khmw * {
    box-sizing: border-box;
}

.khmw {
    --khmw-bg: #071226;
    --khmw-panel: rgba(7, 20, 45, .92);
    --khmw-blue: #0b4da2;
    --khmw-gold: #f6c44b;
    --khmw-gold-2: #fff0a4;
    --khmw-text: #f8fbff;
    --khmw-muted: #b9c9e8;
    --khmw-danger: #d93333;
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    color: var(--khmw-text);
    direction: rtl;
    font-family: Arial, "Rubik", sans-serif;
    line-height: 1.35;
    isolation: isolate;
}

.khmw button,
.khmw input {
    font: inherit;
}

.khmw button {
    cursor: pointer;
}

.khmw-shell {
    position: relative;
    min-height: 760px;
    overflow: hidden;
    border-radius: 28px;
    background:
        radial-gradient(circle at 50% 8%, rgba(43, 111, 255, .42), transparent 28%),
        radial-gradient(circle at 12% 42%, rgba(255, 193, 78, .16), transparent 24%),
        radial-gradient(circle at 88% 45%, rgba(132, 65, 255, .18), transparent 24%),
        linear-gradient(180deg, #07152e 0%, #081c3e 52%, #050d1d 100%);
    border: 1px solid rgba(255, 219, 118, .46);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .42), inset 0 0 80px rgba(20, 97, 220, .12);
}

.khmw-shell:before,
.khmw-shell:after {
    content: "";
    position: absolute;
    inset: auto -8% 0;
    height: 34%;
    pointer-events: none;
}

.khmw-shell:before {
    background:
        linear-gradient(90deg, transparent 0 5%, rgba(255,255,255,.12) 5.5% 6%, transparent 6.5% 12%),
        linear-gradient(180deg, rgba(31, 99, 219, .25), rgba(0,0,0,.1));
    filter: blur(2px);
    opacity: .45;
}

.khmw-shell:after {
    height: 11px;
    bottom: 0;
    background: linear-gradient(90deg, #8a5a12, #ffd669, #8a5a12, #ffd669, #8a5a12);
    box-shadow: 0 -2px 18px rgba(255, 197, 66, .55);
}

.khmw-top {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: minmax(230px, .9fr) minmax(360px, 1.35fr) minmax(250px, 1fr);
    align-items: start;
    gap: 18px;
    padding: 20px 22px 12px;
}

.khmw-logo {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 92px;
    padding: 12px 26px;
    color: #ffe076;
    font-size: clamp(25px, 2.7vw, 46px);
    font-weight: 900;
    text-shadow: 0 2px 0 #6f4600, 0 0 18px rgba(255, 199, 57, .45);
    background: linear-gradient(180deg, #0d326b, #071a3d);
    border: 3px solid #c68a1e;
    border-radius: 34px;
    box-shadow: inset 0 0 18px rgba(255,255,255,.08), 0 8px 26px rgba(0,0,0,.3);
    transform: rotate(-1deg);
}

.khmw-logo small {
    margin-top: 3px;
    padding: 3px 14px;
    color: #fff;
    font-size: 14px;
    background: #c72d2d;
    border-radius: 999px;
    text-shadow: none;
}

.khmw-top-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px;
}

.khmw-chip {
    padding: 8px 14px;
    color: #fff3bc;
    font-weight: 800;
    background: rgba(7, 23, 52, .86);
    border: 1px solid rgba(255, 208, 84, .62);
    border-radius: 999px;
    box-shadow: inset 0 0 12px rgba(255,255,255,.04);
}

.khmw-controls {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
}

.khmw-icon-btn {
    min-width: 46px;
    height: 46px;
    padding: 0 13px;
    color: #fff;
    font-weight: 900;
    background: linear-gradient(180deg, #123a78, #091f47);
    border: 1px solid #6ca8ff;
    border-radius: 14px;
    box-shadow: 0 5px 12px rgba(0,0,0,.25), inset 0 0 12px rgba(255,255,255,.05);
}

.khmw-icon-btn:hover {
    filter: brightness(1.15);
}

.khmw-main {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(220px, .82fr) minmax(430px, 1.55fr) minmax(250px, .9fr);
    gap: 18px;
    align-items: start;
    padding: 0 22px 24px;
}

.khmw-card {
    background: linear-gradient(180deg, rgba(11, 34, 73, .95), rgba(5, 17, 39, .96));
    border: 1px solid rgba(107, 164, 255, .46);
    border-radius: 20px;
    box-shadow: 0 12px 35px rgba(0,0,0,.28), inset 0 0 20px rgba(40, 117, 255, .06);
}

.khmw-host-wrap {
    position: relative;
    min-height: 475px;
    display: flex;
    align-items: end;
    justify-content: center;
}

.khmw-host {
    width: min(100%, 310px);
    max-height: 430px;
    object-fit: contain;
    object-position: bottom center;
    filter: drop-shadow(0 14px 12px rgba(0,0,0,.32));
    transform-origin: 50% 90%;
    transition: transform .35s ease, filter .35s ease;
}

.khmw-host-wrap[data-mood="happy"] .khmw-host {
    transform: translateY(-4px) rotate(-1deg) scale(1.015);
    filter: drop-shadow(0 14px 16px rgba(246,196,75,.22));
}

.khmw-host-wrap[data-mood="spin"] .khmw-host {
    animation: khmw_host_spin 1.1s ease-in-out infinite alternate;
}

.khmw-host-wrap[data-mood="surprised"] .khmw-host {
    transform: rotate(1.5deg) scale(1.02);
}

@keyframes khmw_host_spin {
    from { transform: translateX(-3px) rotate(-.8deg); }
    to { transform: translateX(3px) rotate(.8deg); }
}

.khmw-bubble {
    position: absolute;
    z-index: 3;
    top: 28px;
    left: 50%;
    width: min(92%, 290px);
    transform: translateX(-50%);
    padding: 14px 16px;
    color: #14213a;
    font-size: 15px;
    font-weight: 800;
    text-align: center;
    background: #fff;
    border: 2px solid #d7a63b;
    border-radius: 22px;
    box-shadow: 0 8px 24px rgba(0,0,0,.22);
}

.khmw-bubble:after {
    content: "";
    position: absolute;
    left: 24%;
    bottom: -13px;
    width: 22px;
    height: 22px;
    background: #fff;
    border-right: 2px solid #d7a63b;
    border-bottom: 2px solid #d7a63b;
    transform: rotate(45deg);
}

.khmw-wheel-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.khmw-wheel-wrap {
    position: relative;
    width: min(100%, 520px);
    aspect-ratio: 1;
    margin: 0 auto;
}

.khmw-wheel-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 16px 22px rgba(0,0,0,.36));
}

.khmw-pointer {
    position: absolute;
    z-index: 4;
    top: -5px;
    left: 50%;
    width: 0;
    height: 0;
    transform: translateX(-50%);
    border-left: 19px solid transparent;
    border-right: 19px solid transparent;
    border-top: 0;
    border-bottom: 42px solid #e1302d;
    filter: drop-shadow(0 4px 2px rgba(0,0,0,.4));
    transform-origin: 50% 8px;
}

.khmw-pointer.khmw-hit {
    animation: khmw_pointer_hit 120ms ease-out;
}

.khmw-pointer.khmw-stop {
    animation: khmw_pointer_stop .55s ease-out;
}

@keyframes khmw_pointer_hit {
    0% { transform: translateX(-50%) rotate(0); }
    45% { transform: translateX(-50%) rotate(8deg); }
    100% { transform: translateX(-50%) rotate(0); }
}

@keyframes khmw_pointer_stop {
    0% { transform: translateX(-50%) rotate(0); }
    22% { transform: translateX(-50%) rotate(13deg); }
    50% { transform: translateX(-50%) rotate(-8deg); }
    72% { transform: translateX(-50%) rotate(4deg); }
    100% { transform: translateX(-50%) rotate(0); }
}

.khmw-wheel-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 8px;
}

.khmw-btn {
    min-height: 48px;
    padding: 10px 22px;
    color: #fff;
    font-weight: 900;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 15px;
    box-shadow: 0 8px 18px rgba(0,0,0,.24), inset 0 0 0 1px rgba(255,255,255,.08);
    transition: transform .12s ease, filter .12s ease;
}

.khmw-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.khmw-btn:active:not(:disabled) {
    transform: translateY(1px) scale(.99);
}

.khmw-btn:disabled {
    cursor: not-allowed;
    opacity: .46;
}

.khmw-btn-primary {
    background: linear-gradient(180deg, #1ac452, #087b31);
}

.khmw-btn-blue {
    background: linear-gradient(180deg, #2583f1, #0c4ca8);
}

.khmw-btn-gold {
    color: #16203b;
    background: linear-gradient(180deg, #ffe37a, #d99d19);
    border-color: #fff0a0;
}

.khmw-btn-danger {
    background: linear-gradient(180deg, #e24b4b, #a61919);
}

.khmw-result-strip {
    min-height: 38px;
    margin-top: 8px;
    padding: 8px 14px;
    color: #fff2bb;
    font-weight: 900;
    text-align: center;
    background: rgba(6, 21, 49, .84);
    border: 1px solid rgba(255, 203, 72, .5);
    border-radius: 999px;
}

.khmw-word {
    width: 100%;
    margin-top: 12px;
    padding: 13px 14px 16px;
    background: linear-gradient(180deg, rgba(4,17,42,.98), rgba(8,35,75,.96));
    border: 2px solid #dca82c;
    border-radius: 18px;
    box-shadow: inset 0 0 20px rgba(32,110,220,.16), 0 10px 22px rgba(0,0,0,.24);
}

.khmw-word-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
    margin-bottom: 10px;
    color: #dce9ff;
    font-size: 13px;
    font-weight: 800;
}

.khmw-word-tiles {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.khmw-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(34px, 4.2vw, 50px);
    height: clamp(44px, 5.2vw, 60px);
    color: #14213a;
    font-size: clamp(22px, 3vw, 34px);
    font-weight: 900;
    background: linear-gradient(180deg, #fff, #dce8fb);
    border: 2px solid #a8b9d6;
    border-radius: 8px;
    box-shadow: inset 0 -5px 9px rgba(56,88,134,.11), 0 3px 0 #856316;
}

.khmw-tile.khmw-hidden {
    color: transparent;
    background: linear-gradient(180deg, #124687, #08265a);
    border-color: #4778bd;
}

.khmw-space {
    width: 15px;
}

.khmw-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.khmw-section-title {
    padding-bottom: 8px;
    margin-bottom: 9px;
    color: #ffe58d;
    font-size: 16px;
    font-weight: 900;
    border-bottom: 1px solid rgba(255,210,90,.34);
}

.khmw-players {
    padding: 12px;
}

.khmw-player {
    display: grid;
    grid-template-columns: 38px 1fr auto;
    gap: 9px;
    align-items: center;
    padding: 9px;
    margin-bottom: 7px;
    color: #e8f1ff;
    background: rgba(11, 44, 92, .7);
    border: 1px solid rgba(88, 143, 222, .48);
    border-radius: 13px;
}

.khmw-player:last-child {
    margin-bottom: 0;
}

.khmw-player.khmw-active {
    color: #1a2440;
    background: linear-gradient(90deg, #f8c337, #ffe786);
    border-color: #fff1a4;
    box-shadow: 0 0 18px rgba(255, 202, 52, .28);
}

.khmw-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-weight: 900;
    background: rgba(255,255,255,.12);
    border-radius: 50%;
}

.khmw-score {
    color: #ffd24a;
    font-size: 20px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.khmw-active .khmw-score {
    color: #5b3a00;
}

.khmw-round-score {
    font-size: 11px;
    opacity: .78;
}

.khmw-question {
    padding: 15px;
    background: linear-gradient(180deg, #fff8e8, #f2e2bc);
    color: #15213c;
    border: 3px solid #c99731;
    border-radius: 18px;
    box-shadow: 0 9px 24px rgba(0,0,0,.28);
}

.khmw-question .khmw-section-title {
    color: #183c78;
    border-color: #c9aa68;
}

.khmw-q-text {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    margin: 8px 0 12px;
    font-size: clamp(20px, 2vw, 28px);
    font-weight: 900;
    text-align: center;
    background: rgba(255,255,255,.72);
    border: 1px solid #cbb98c;
    border-radius: 12px;
}

.khmw-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 8px;
}

.khmw-option {
    min-height: 44px;
    padding: 8px;
    color: #fff;
    font-weight: 900;
    background: linear-gradient(180deg, #1769c9, #0b438d);
    border: 1px solid #8bbaff;
    border-radius: 11px;
}

.khmw-num-display {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 9px;
    color: #13203a;
    font-size: 28px;
    font-weight: 900;
    background: #fff;
    border: 2px solid #b89a55;
    border-radius: 11px;
    direction: ltr;
}

.khmw-pad {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 6px;
}

.khmw-pad button {
    min-height: 39px;
    color: #fff;
    font-weight: 900;
    background: #164e98;
    border: 1px solid #8eb9f3;
    border-radius: 9px;
}

.khmw-pad .khmw-del {
    background: #9f2e2e;
}

.khmw-feedback {
    padding: 10px;
    margin-top: 10px;
    font-weight: 900;
    text-align: center;
    border-radius: 10px;
}

.khmw-feedback.ok {
    color: #0b4d29;
    background: #c9f3d6;
    border: 1px solid #7ac995;
}

.khmw-feedback.bad {
    color: #7b1919;
    background: #ffd4d4;
    border: 1px solid #d98a8a;
}

.khmw-keyboard {
    padding: 12px;
}

.khmw-key-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
}

.khmw-key {
    min-width: 0;
    min-height: 39px;
    padding: 3px;
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    background: linear-gradient(180deg, #175db6, #0b3777);
    border: 1px solid #67a4f0;
    border-radius: 8px;
}

.khmw-key:disabled {
    color: #7f91aa;
    background: #14243b;
    border-color: #344b6c;
    cursor: not-allowed;
}

.khmw-prizes {
    padding: 12px;
}

.khmw-prize-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.khmw-prize-chip {
    padding: 6px 8px;
    color: #ffefb1;
    font-size: 12px;
    font-weight: 800;
    background: rgba(119, 78, 0, .25);
    border: 1px solid rgba(255, 204, 70, .38);
    border-radius: 999px;
}

.khmw-setup {
    position: relative;
    z-index: 2;
    width: min(940px, calc(100% - 30px));
    margin: 0 auto;
    padding: 28px 0 34px;
}

.khmw-setup-head {
    text-align: center;
    margin-bottom: 18px;
}

.khmw-setup-head h2 {
    margin: 0;
    color: #ffe171;
    font-size: clamp(32px, 5vw, 58px);
    text-shadow: 0 3px 0 #6d4300, 0 0 25px rgba(255,199,57,.35);
}

.khmw-setup-head p {
    color: #d7e4fb;
    font-size: 17px;
    font-weight: 800;
}

.khmw-setup-card {
    padding: 20px;
}

.khmw-step {
    padding: 15px;
    margin-bottom: 12px;
    background: rgba(8, 29, 62, .72);
    border: 1px solid rgba(89,145,226,.4);
    border-radius: 15px;
}

.khmw-step h3 {
    margin: 0 0 11px;
    color: #ffe58e;
    font-size: 18px;
}

.khmw-grade-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 7px;
}

.khmw-grade {
    min-height: 49px;
    color: #e9f2ff;
    font-weight: 900;
    background: #0c326d;
    border: 1px solid #4f83ca;
    border-radius: 11px;
}

.khmw-grade.active {
    color: #1b2540;
    background: linear-gradient(180deg, #ffe27a, #dba11d);
    border-color: #fff0a0;
}

.khmw-topic-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 7px;
}

.khmw-topic {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    padding: 8px 10px;
    color: #dfeaff;
    text-align: right;
    background: #0c2c60;
    border: 1px solid #446fa9;
    border-radius: 11px;
}

.khmw-topic.active {
    color: #fff4c0;
    border-color: #d8a631;
    background: #173b72;
}

.khmw-topic span {
    display: block;
}

.khmw-topic small {
    display: block;
    margin-top: 2px;
    color: #a9bddf;
    font-size: 11px;
}

.khmw-player-count {
    display: flex;
    gap: 7px;
}

.khmw-player-count button {
    flex: 1;
    min-height: 45px;
    color: #e9f2ff;
    font-weight: 900;
    background: #0c326d;
    border: 1px solid #4f83ca;
    border-radius: 10px;
}

.khmw-player-count button.active {
    color: #1b2540;
    background: #f4c646;
    border-color: #fff0a0;
}

.khmw-name-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 8px;
    margin-top: 9px;
}

.khmw-name-grid input {
    width: 100%;
    min-height: 45px;
    padding: 8px 10px;
    color: #fff;
    background: #071c3d;
    border: 1px solid #547fc0;
    border-radius: 10px;
    outline: 0;
}

.khmw-name-grid input:focus {
    border-color: #f4c646;
    box-shadow: 0 0 0 2px rgba(244,198,70,.15);
}

.khmw-start {
    width: 100%;
    min-height: 58px;
    margin-top: 6px;
    font-size: 21px;
}

.khmw-modal {
    position: absolute;
    z-index: 20;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(2, 8, 20, .76);
    backdrop-filter: blur(5px);
}

.khmw-modal-card {
    width: min(520px, 100%);
    padding: 22px;
    text-align: center;
    background: linear-gradient(180deg, #0d3268, #07182f);
    border: 3px solid #e0ae35;
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(0,0,0,.48), 0 0 35px rgba(255,196,60,.13);
}

.khmw-modal-card h3 {
    margin: 0 0 8px;
    color: #ffe17b;
    font-size: 28px;
}

.khmw-modal-card input {
    width: 100%;
    min-height: 53px;
    margin: 12px 0;
    padding: 9px 12px;
    color: #16203a;
    font-size: 24px;
    font-weight: 900;
    text-align: center;
    background: #fff;
    border: 2px solid #d8ae52;
    border-radius: 12px;
    outline: 0;
}

.khmw-modal-actions {
    display: flex;
    gap: 8px;
}

.khmw-modal-actions .khmw-btn {
    flex: 1;
}

.khmw-prize-big {
    margin: 12px 0;
    font-size: 58px;
}

.khmw-gameover {
    position: relative;
    z-index: 3;
    width: min(760px, calc(100% - 30px));
    margin: 0 auto;
    padding: 44px 0;
    text-align: center;
}

.khmw-gameover h2 {
    margin: 0 0 10px;
    color: #ffe079;
    font-size: clamp(34px, 5vw, 58px);
}

.khmw-winner {
    padding: 20px;
    margin: 15px 0;
    color: #17203a;
    background: linear-gradient(180deg, #ffe782, #d89c16);
    border: 2px solid #fff0a4;
    border-radius: 18px;
    box-shadow: 0 14px 40px rgba(0,0,0,.28);
}

.khmw-final-list {
    display: grid;
    gap: 7px;
    margin: 14px 0;
}

.khmw-final-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 14px;
    background: rgba(8,31,68,.85);
    border: 1px solid rgba(84,133,204,.48);
    border-radius: 12px;
}

.khmw-frac {
    display: inline-grid;
    grid-template-rows: auto 2px auto;
    align-items: center;
    min-width: 1.15em;
    margin: 0 .12em;
    vertical-align: middle;
    line-height: 1;
    direction: ltr;
}

.khmw-frac > span:first-child,
.khmw-frac > span:last-child {
    display: block;
    padding: 0 .12em;
    text-align: center;
}

.khmw-frac > i {
    display: block;
    width: 100%;
    height: 2px;
    background: currentColor;
}

.khmw-confetti {
    position: absolute;
    z-index: 12;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.khmw-confetti i {
    position: absolute;
    top: -20px;
    width: 9px;
    height: 15px;
    border-radius: 2px;
    animation: khmw_confetti 2.8s linear forwards;
}

@keyframes khmw_confetti {
    to {
        transform: translate3d(var(--x), 820px, 0) rotate(740deg);
        opacity: .1;
    }
}

@media (max-width: 1120px) {
    .khmw-top,
    .khmw-main {
        grid-template-columns: 220px minmax(360px,1fr);
    }

    .khmw-top-meta {
        justify-content: flex-start;
    }

    .khmw-controls {
        grid-column: 2;
        grid-row: 1;
    }

    .khmw-side {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(2, minmax(0,1fr));
    }
}

@media (max-width: 760px) {
    .khmw-shell {
        min-height: 0;
        border-radius: 18px;
    }

    .khmw-top,
    .khmw-main {
        display: flex;
        flex-direction: column;
        padding-left: 12px;
        padding-right: 12px;
    }

    .khmw-logo {
        width: 100%;
        min-height: 70px;
        font-size: 30px;
    }

    .khmw-top-meta,
    .khmw-controls {
        width: 100%;
        justify-content: center;
    }

    .khmw-wheel-zone {
        order: 1;
        width: 100%;
    }

    .khmw-host-wrap {
        order: 2;
        width: 100%;
        min-height: 300px;
    }

    .khmw-host {
        max-height: 280px;
        width: 220px;
    }

    .khmw-bubble {
        top: 2px;
        left: calc(50% + 80px);
        width: 210px;
        font-size: 13px;
    }

    .khmw-side {
        order: 3;
        display: flex;
        width: 100%;
    }

    .khmw-grade-grid {
        grid-template-columns: repeat(3,1fr);
    }

    .khmw-topic-grid {
        grid-template-columns: 1fr;
    }

    .khmw-name-grid {
        grid-template-columns: 1fr;
    }

    .khmw-key-grid {
        grid-template-columns: repeat(6,1fr);
    }

    .khmw-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 440px) {
    .khmw-bubble {
        position: relative;
        top: auto;
        left: auto;
        width: calc(100% - 20px);
        margin: 8px auto 0;
        transform: none;
        order: -1;
    }

    .khmw-bubble:after {
        display: none;
    }

    .khmw-host-wrap {
        flex-direction: column;
        justify-content: flex-end;
        min-height: 340px;
    }

    .khmw-key-grid {
        grid-template-columns: repeat(5,1fr);
    }

    .khmw-wheel-actions .khmw-btn {
        flex: 1 1 100%;
    }
}

/* KalHeshbon Core integration */
.khmw-loading {
    max-width: 760px;
    margin: 32px auto;
    padding: 24px;
    color: #536037;
    text-align: center;
    font: 700 16px/1.6 Arial, sans-serif;
}

.khmw-corebar {
    display: grid;
    grid-template-columns: minmax(240px, 1.25fr) minmax(220px, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    padding: 12px 14px;
    color: #eaf2ff;
    background: rgba(5, 20, 44, .9);
    border: 1px solid rgba(109, 162, 239, .42);
    border-radius: 16px;
    box-shadow: inset 0 0 18px rgba(67, 127, 219, .06);
}

.khmw-core-status {
    min-width: 0;
}

.khmw-core-status strong,
.khmw-core-status span {
    display: block;
}

.khmw-core-status strong {
    color: #ffe58c;
    font-size: 14px;
}

.khmw-core-status span {
    margin-top: 3px;
    color: #bac9e6;
    font-size: 12px;
}

.khmw-folder-label {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.khmw-folder-label > span {
    color: #b9c9e8;
    font-size: 11px;
    font-weight: 800;
}

.khmw-folder-label select {
    width: 100%;
    min-height: 40px;
    padding: 0 10px;
    color: #f8fbff;
    background: #071c3d;
    border: 1px solid #547fc0;
    border-radius: 10px;
    outline: 0;
}

.khmw-folder-label select:focus {
    border-color: #f4c646;
    box-shadow: 0 0 0 2px rgba(244,198,70,.15);
}

.khmw-folder-label select:disabled {
    opacity: .74;
    cursor: not-allowed;
}

.khmw-balance-box {
    display: grid;
    min-width: 80px;
    justify-items: center;
    padding: 7px 10px;
    color: #fff1ae;
    background: #0b2c61;
    border: 1px solid rgba(246,196,75,.55);
    border-radius: 12px;
}

.khmw-balance-box small,
.khmw-balance-box span {
    color: #b9c9e8;
    font-size: 9px;
    font-weight: 800;
}

.khmw-balance-box strong {
    font-size: 18px;
    line-height: 1;
}

.khmw-topup {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 0 13px;
    color: #17203a !important;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 900;
    background: linear-gradient(180deg, #ffe078, #dba31f);
    border: 1px solid #fff0a0;
    border-radius: 10px;
}

.khmw-start-error {
    margin: -4px 0 14px;
    padding: 10px 14px;
    color: #ffe5e5;
    font-size: 13px;
    font-weight: 800;
    background: rgba(128, 18, 29, .75);
    border: 1px solid rgba(255, 119, 128, .65);
    border-radius: 12px;
}

.khmw-math-expression,
.khmw .kal-math-expression {
    display: inline-flex;
    align-items: center;
    gap: .12em;
    direction: ltr !important;
    unicode-bidi: isolate;
}

.khmw-frac {
    unicode-bidi: isolate;
}

.khmw:fullscreen {
    max-width: none;
    width: 100vw;
    height: 100vh;
    padding: 0;
    overflow: auto;
    background: #050d1d;
}

.khmw:fullscreen .khmw-shell {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.khmw:fullscreen .khmw-main {
    min-height: calc(100vh - 125px);
}

@media (max-width: 900px) {
    .khmw-corebar {
        grid-template-columns: 1fr 1fr;
    }

    .khmw-core-status {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {
    .khmw-corebar {
        grid-template-columns: 1fr;
    }

    .khmw-core-status {
        grid-column: auto;
    }

    .khmw-balance-box {
        grid-template-columns: auto auto auto;
        justify-content: center;
        gap: 6px;
    }
}
.khmw-corebar-login {
    grid-template-columns: 1fr;
    text-align: center;
}

.khmw-topic-limit {
    display: block;
    margin: -3px 0 8px;
    color: #a9bddf;
    font-size: 11px;
    font-weight: 700;
}

/* 1.7.0 TV stage layout - approved 16:9 mockup */
.khmw.khmw-game-active {
    position: relative;
    left: 50%;
    width: min(1780px, calc(100vw - 18px));
    max-width: none;
    margin: 0;
    transform: translateX(-50%);
}

.khmw-shell-game {
    min-height: 790px;
    aspect-ratio: 16 / 9;
    border-radius: 22px;
    background:
        radial-gradient(circle at 3% 8%, rgba(44, 117, 255, .5), transparent 16%),
        radial-gradient(circle at 96% 8%, rgba(44, 117, 255, .42), transparent 15%),
        radial-gradient(circle at 50% 38%, rgba(24, 72, 157, .24), transparent 38%),
        linear-gradient(180deg, #020a1c 0%, #03132d 50%, #020b1d 100%);
    border-color: rgba(221, 157, 34, .58);
    box-shadow: 0 24px 80px rgba(0,0,0,.48), inset 0 0 90px rgba(27,92,197,.12);
}

.khmw-shell-game:before {
    inset: 0;
    height: 100%;
    opacity: .52;
    background:
        radial-gradient(circle at 10% 16%, rgba(255,204,66,.8) 0 1px, transparent 2px) 0 0 / 86px 76px,
        radial-gradient(circle at 72% 34%, rgba(255,149,35,.65) 0 1px, transparent 2px) 0 0 / 112px 93px,
        linear-gradient(115deg, transparent 0 47%, rgba(43,120,255,.08) 49%, transparent 51%);
    filter: none;
}

.khmw-shell-game:after {
    display: none;
}

.khmw-top-game {
    direction: ltr;
    grid-template-columns: minmax(235px, 1fr) auto minmax(280px, 1fr);
    grid-template-areas: "controls meta logo";
    align-items: center;
    min-height: 108px;
    padding: 16px 28px 8px;
}

.khmw-top-game .khmw-logo {
    grid-area: logo;
    justify-self: end;
    min-width: 260px;
    min-height: 82px;
    padding: 6px 22px;
    direction: rtl;
    color: #ffd85d;
    font-size: clamp(34px, 3vw, 58px);
    line-height: 1;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: none;
    text-shadow: 0 3px 0 #764900, 0 0 22px rgba(255,190,36,.42);
}

.khmw-top-game .khmw-logo small {
    min-width: 135px;
    margin-top: 10px;
    padding: 5px 18px;
    font-size: 15px;
    background: linear-gradient(180deg, #f0443d, #b81319);
    border: 1px solid rgba(255,142,112,.9);
    box-shadow: 0 0 14px rgba(225,38,37,.32);
}

.khmw-top-game .khmw-top-meta {
    grid-area: meta;
    direction: rtl;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.khmw-top-game .khmw-chip {
    min-width: 120px;
    padding: 10px 18px;
    text-align: center;
    color: #ffe29a;
    background: rgba(3,13,34,.86);
    border-color: rgba(222,157,32,.75);
    box-shadow: 0 3px 12px rgba(0,0,0,.22);
}

.khmw-top-game .khmw-controls {
    grid-area: controls;
    direction: rtl;
    justify-self: start;
    justify-content: flex-start;
}

.khmw-top-game .khmw-icon-btn {
    min-width: 94px;
    height: 42px;
    color: #fff1c7;
    background: rgba(4,16,40,.88);
    border-color: rgba(222,157,32,.68);
}

.khmw-scorebar {
    position: relative;
    z-index: 5;
    display: flex;
    justify-content: center;
    gap: 9px;
    min-height: 46px;
    padding: 0 24px 7px;
    direction: rtl;
}

.khmw-score-pill {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    column-gap: 10px;
    min-width: 188px;
    padding: 7px 13px 8px;
    color: #e9f1ff;
    background: rgba(4,18,44,.82);
    border: 1px solid rgba(84,133,204,.48);
    border-radius: 14px;
    box-shadow: 0 6px 14px rgba(0,0,0,.2);
}

.khmw-score-name {
    font-weight: 900;
}

.khmw-score-pill strong {
    grid-row: 1 / 3;
    grid-column: 2;
    align-self: center;
    color: #ffd450;
    font-size: 24px;
    line-height: 1;
}

.khmw-score-total-label {
    color: #9fb2d4;
    font-size: 10px;
}

.khmw-score-round {
    grid-column: 1 / -1;
    margin-top: 2px;
    color: #fff5ce;
    font-size: 11px;
    font-weight: 800;
}

.khmw-score-pill.is-active {
    color: #fff5ce;
    border-color: #dba128;
    box-shadow: 0 0 18px rgba(255,190,36,.2), inset 0 0 12px rgba(255,190,36,.08);
}

.khmw-tv-main {
    direction: ltr;
    display: grid;
    grid-template-columns: minmax(0, 54fr) minmax(0, 46fr);
    gap: clamp(16px, 1.4vw, 28px);
    align-items: stretch;
    height: calc(100% - 154px);
    min-height: 620px;
    padding: 2px 28px 24px;
}

.khmw-left-stage,
.khmw-right-stage {
    min-width: 0;
    direction: rtl;
}

.khmw-left-stage {
    display: grid;
    grid-template-rows: minmax(300px, 1.1fr) auto minmax(270px, .95fr);
    gap: 8px;
    align-items: stretch;
}

.khmw-marquee {
    position: relative;
    width: 100%;
    min-height: 320px;
    margin: 0;
    padding: 20px;
    overflow: hidden;
    background: linear-gradient(180deg, #071d45, #031027);
    border: 4px solid #d69a20;
    border-radius: 36px;
    box-shadow:
        inset 0 0 0 5px #69440d,
        inset 0 0 32px rgba(19,90,193,.28),
        0 12px 28px rgba(0,0,0,.36),
        0 0 24px rgba(255,176,33,.12);
}

.khmw-bulbs {
    position: absolute;
    z-index: 2;
    inset: 4px;
    pointer-events: none;
    border-radius: 30px;
    background:
        radial-gradient(circle, #fffad2 0 22%, #ffd247 25% 41%, #a45e00 44% 52%, transparent 55%) top left / 34px 34px repeat-x,
        radial-gradient(circle, #fffad2 0 22%, #ffd247 25% 41%, #a45e00 44% 52%, transparent 55%) bottom left / 34px 34px repeat-x,
        radial-gradient(circle, #fffad2 0 22%, #ffd247 25% 41%, #a45e00 44% 52%, transparent 55%) top left / 34px 34px repeat-y,
        radial-gradient(circle, #fffad2 0 22%, #ffd247 25% 41%, #a45e00 44% 52%, transparent 55%) top right / 34px 34px repeat-y;
    filter: drop-shadow(0 0 5px rgba(255,193,41,.9));
}

.khmw-word-board {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 255px;
    height: 100%;
    padding: 38px 28px 52px;
    background:
        radial-gradient(circle at 50% 50%, rgba(27,87,182,.22), transparent 42%),
        linear-gradient(180deg, rgba(4,19,48,.98), rgba(3,14,34,.99));
    border: 1px solid rgba(27,85,171,.66);
    border-radius: 22px;
    box-shadow: inset 0 0 32px rgba(45,105,210,.13);
}

.khmw-word-meta {
    position: absolute;
    z-index: 5;
    right: 50%;
    bottom: 12px;
    width: calc(100% - 76px);
    margin: 0;
    transform: translateX(50%);
    gap: 8px;
    color: #dce7fb;
    font-size: 12px;
}

.khmw-word-meta span {
    padding: 4px 10px;
    background: rgba(5,18,43,.74);
    border: 1px solid rgba(213,157,38,.34);
    border-radius: 999px;
}

.khmw-word-tiles {
    position: relative;
    z-index: 4;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: clamp(6px, .7vw, 12px);
    width: 100%;
}

.khmw-tile-frame {
    position: relative;
    display: inline-block;
    width: clamp(50px, 4.6vw, 82px);
    height: clamp(82px, 7.2vw, 126px);
    perspective: 950px;
}

.khmw-tile-frame:before {
    content: "";
    position: absolute;
    z-index: 0;
    top: -8px;
    bottom: -8px;
    left: 50%;
    width: 3px;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #694008, #ffd15a 12%, #a7650d 50%, #ffd15a 88%, #694008);
    border-radius: 3px;
    box-shadow: 0 0 6px rgba(255,189,40,.5);
}

.khmw-tile-frame:after {
    content: "";
    position: absolute;
    z-index: 4;
    top: -8px;
    left: 50%;
    width: 8px;
    height: 8px;
    transform: translateX(-50%);
    background: #ffd15a;
    border: 2px solid #76500d;
    border-radius: 50%;
    box-shadow: 0 calc(clamp(82px, 7.2vw, 126px) + 8px) 0 -2px #ffd15a;
    pointer-events: none;
}

.khmw-tile-card {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transform-origin: 50% 50%;
}

.khmw-tile-card.khmw-open {
    transform: rotateY(180deg);
}

.khmw-tile-card.khmw-reveal {
    animation: khmw_vertical_flip .92s cubic-bezier(.2,.72,.14,1) forwards;
}

.khmw-tile-letter {
    position: absolute;
    z-index: 5;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffd45b;
    font-size: clamp(34px, 4.5vw, 68px);
    font-weight: 900;
    text-shadow: 0 2px 0 #704700, 0 0 16px rgba(255,201,60,.42);
    opacity: 0;
    transform: scale(.76);
    pointer-events: none;
}

.khmw-letter-open .khmw-tile-letter {
    opacity: 1;
    transform: scale(1);
}

.khmw-letter-reveal .khmw-tile-letter {
    opacity: 0;
    transform: scale(.68);
    animation: khmw_tile_letter_show .92s cubic-bezier(.2,.72,.14,1) forwards;
}

.khmw-tile-face {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    backface-visibility: hidden;
    border: 2px solid #c98c18;
    border-radius: 12px;
    box-shadow: inset 0 0 16px rgba(54,121,222,.12), 0 8px 15px rgba(0,0,0,.26);
}

.khmw-tile-front {
    background: linear-gradient(145deg, #0d376d, #061c42 62%, #0b2b5a);
}

.khmw-tile-front:after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,.08) 43%, transparent 60%);
}

.khmw-tile-back {
    color: #ffd45b;
    font-size: clamp(34px, 4.5vw, 68px);
    font-weight: 900;
    background:
        radial-gradient(circle at 50% 50%, rgba(255,190,45,.15), transparent 42%),
        linear-gradient(145deg, #104488, #071f4a 64%, #0d356f);
    transform: rotateY(180deg);
    text-shadow: 0 2px 0 #704700, 0 0 16px rgba(255,201,60,.42);
}

@keyframes khmw_vertical_flip {
    0% { transform: rotateY(0); }
    38% { transform: rotateY(82deg) scale(1.04); filter: brightness(1.22); }
    54% { transform: rotateY(112deg) scale(1.05); filter: brightness(1.35) drop-shadow(0 0 16px rgba(255,196,42,.75)); }
    100% { transform: rotateY(180deg); filter: none; }
}

@keyframes khmw_tile_letter_show {
    0%, 46% { opacity: 0; transform: scale(.68); }
    62% { opacity: 1; transform: scale(1.12); }
    100% { opacity: 1; transform: scale(1); }
}

.khmw-space {
    width: clamp(14px, 1.4vw, 26px);
}

.khmw-reveal-callout {
    position: relative;
    z-index: 6;
    min-height: 62px;
    padding: 2px 12px;
    text-align: center;
    line-height: 1.1;
}

.khmw-reveal-callout strong,
.khmw-reveal-callout span {
    display: block;
}

.khmw-reveal-callout strong {
    color: #f6ce50;
    font-size: clamp(24px, 2.6vw, 44px);
    font-weight: 900;
    text-shadow: 0 2px 0 #724500, 0 0 16px rgba(255,190,33,.24);
}

.khmw-reveal-callout span {
    margin-top: 2px;
    color: #fff;
    font-size: clamp(13px, 1.2vw, 18px);
    font-weight: 900;
}

.khmw-reveal-callout.is-on strong {
    animation: khmw_reveal_pop .72s ease-out;
}

@keyframes khmw_reveal_pop {
    0% { transform: scale(.82); opacity: .2; }
    55% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); }
}

.khmw-prize-stage {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 230px;
    overflow: visible;
}

.khmw-prize-stage > img {
    display: block;
    width: 100%;
    max-height: 330px;
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 12px 16px rgba(0,0,0,.28));
    pointer-events: none;
    user-select: none;
}

.khmw-prize-earned {
    position: absolute;
    z-index: 5;
    right: 50%;
    bottom: 4px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    width: 90%;
    transform: translateX(50%);
    pointer-events: none;
}

.khmw-prize-earned span {
    padding: 5px 12px;
    color: #ffe69b;
    font-size: 11px;
    font-weight: 900;
    background: rgba(2,11,29,.82);
    border: 1px solid rgba(218,153,31,.72);
    border-radius: 999px;
}

.khmw-right-stage {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: stretch;
}

.khmw-wheel-layout {
    direction: ltr;
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(150px, 11vw, 205px);
    gap: clamp(10px, 1vw, 18px);
    width: 100%;
    height: 100%;
    min-height: 590px;
    align-items: start;
}

.khmw-wheel-column {
    position: relative;
    direction: rtl;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.khmw-shell-game .khmw-wheel-wrap {
    width: min(100%, 650px);
    max-height: 650px;
    margin: 0 auto;
}

.khmw-shell-game .khmw-wheel-wrap canvas {
    filter: drop-shadow(0 13px 22px rgba(0,0,0,.42)) drop-shadow(0 0 8px rgba(255,183,31,.16));
}

.khmw-shell-game .khmw-pointer {
    top: -11px;
    border-left-width: 24px;
    border-right-width: 24px;
    border-bottom-width: 52px;
}

.khmw-wheel-value {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 112px;
    min-height: 64px;
    margin-top: -3px;
    padding: 5px 18px;
    color: #ffd869;
    background: rgba(3,12,31,.86);
    border: 1px solid rgba(213,150,28,.72);
    border-radius: 24px;
    box-shadow: 0 8px 18px rgba(0,0,0,.24);
}

.khmw-wheel-value strong {
    color: #f5f3e8;
    font-size: 27px;
    line-height: 1;
}

.khmw-wheel-value span {
    margin-top: 3px;
    font-size: 12px;
    font-weight: 900;
}

.khmw-shell-game .khmw-wheel-actions {
    margin-top: 8px;
}

.khmw-shell-game .khmw-wheel-actions .khmw-btn {
    min-height: 43px;
    padding: 8px 17px;
    border-color: rgba(220,156,31,.78);
    border-radius: 14px;
}

.khmw-announcer {
    width: min(95%, 500px);
    min-height: 42px;
    margin-top: 8px;
    padding: 8px 13px;
    color: #f3f6ff;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    background: rgba(3,15,38,.82);
    border: 1px solid rgba(87,129,195,.45);
    border-radius: 14px;
}

.khmw-question-slot {
    position: absolute;
    z-index: 20;
    top: 48%;
    left: 50%;
    width: min(92%, 430px);
    transform: translate(-50%, -35%);
    direction: rtl;
}

.khmw-question-slot .khmw-question {
    border-color: #d49a25;
    box-shadow: 0 18px 48px rgba(0,0,0,.52), 0 0 0 5px rgba(4,15,37,.6);
}

.khmw-question-slot .khmw-q-text {
    min-height: 58px;
    margin: 6px 0 8px;
    font-size: clamp(18px, 1.6vw, 25px);
}

.khmw-question-slot .khmw-pad button,
.khmw-question-slot .khmw-option {
    min-height: 36px;
}

.khmw-shell-game .khmw-keyboard {
    direction: rtl;
    align-self: start;
    min-height: 575px;
    padding: 14px 11px;
    background: linear-gradient(180deg, rgba(4,18,44,.94), rgba(2,10,26,.97));
    border: 2px solid rgba(211,149,30,.72);
    border-radius: 18px;
    box-shadow: 0 12px 28px rgba(0,0,0,.3), inset 0 0 20px rgba(38,94,179,.07);
}

.khmw-riddle-box {
    margin-bottom: 12px;
    padding: 10px 10px 12px;
    text-align: center;
    background: linear-gradient(180deg, rgba(12,38,82,.96), rgba(6,20,44,.98));
    border: 1px solid rgba(223,166,45,.58);
    border-radius: 14px;
    box-shadow: inset 0 0 12px rgba(64,129,228,.12);
}

.khmw-riddle-label {
    color: #ffe07a;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .02em;
}

.khmw-riddle-text {
    margin-top: 4px;
    color: #fff;
    font-size: clamp(20px, 1.55vw, 28px);
    font-weight: 900;
    line-height: 1.15;
    text-shadow: 0 1px 0 #0d1627, 0 0 10px rgba(255,210,94,.14);
}

.khmw-riddle-category {
    margin-top: 6px;
    color: #cfe0ff;
    font-size: 12px;
    font-weight: 800;
}

.khmw-shell-game .khmw-keyboard .khmw-section-title {
    margin-bottom: 12px;
    padding-bottom: 8px;
    color: #ffd960;
    font-size: 18px;
    text-align: center;
    border-bottom-color: rgba(211,149,30,.42);
}

.khmw-shell-game .khmw-key-grid {
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 7px;
}

.khmw-shell-game .khmw-key {
    position: relative;
    min-height: 53px;
    padding: 3px;
    overflow: hidden;
    color: #f7f3e7;
    font-size: clamp(20px, 1.65vw, 29px);
    background: linear-gradient(180deg, #0b264f, #07172f);
    border: 1px solid rgba(198,142,38,.78);
    border-radius: 7px;
    box-shadow: inset 0 0 8px rgba(48,104,188,.12);
}

.khmw-shell-game .khmw-keyboard.is-active .khmw-key:not(.khmw-used) {
    color: #fff;
    border-color: #e5aa35;
    box-shadow: 0 0 10px rgba(255,184,42,.13), inset 0 0 9px rgba(67,126,216,.18);
}

.khmw-shell-game .khmw-key:disabled:not(.khmw-used) {
    color: #f7f3e7;
    background: linear-gradient(180deg, #0b264f, #07172f);
    border-color: rgba(198,142,38,.58);
    opacity: .9;
    cursor: default;
}

.khmw-shell-game .khmw-key.khmw-used,
.khmw-shell-game .khmw-key.khmw-used:disabled {
    color: #8b94a5;
    background: linear-gradient(180deg, #0a1628, #060d19);
    border-color: rgba(117,108,88,.55);
    opacity: 1;
}

.khmw-shell-game .khmw-key.khmw-used:after {
    content: "";
    position: absolute;
    z-index: 4;
    top: 50%;
    left: -12%;
    width: 124%;
    height: 2px;
    transform: rotate(-43deg);
    background: #e93838;
    box-shadow: 0 0 4px rgba(239,53,53,.45);
}

@media (max-width: 1320px) {
    .khmw-shell-game {
        min-height: 750px;
        aspect-ratio: auto;
    }

    .khmw-tv-main {
        grid-template-columns: minmax(0, 53fr) minmax(0, 47fr);
        min-height: 610px;
        padding-inline: 18px;
    }

    .khmw-wheel-layout {
        grid-template-columns: minmax(0,1fr) 155px;
    }

    .khmw-shell-game .khmw-key {
        min-height: 48px;
    }
}

@media (max-width: 1050px) {
    .khmw.khmw-game-active {
        left: auto;
        width: 100%;
        transform: none;
    }

    .khmw-shell-game {
        min-height: 0;
        aspect-ratio: auto;
    }

    .khmw-top-game {
        grid-template-columns: 1fr 1fr;
        grid-template-areas: "logo controls" "meta meta";
        min-height: 0;
    }

    .khmw-top-game .khmw-logo {
        justify-self: start;
    }

    .khmw-top-game .khmw-controls {
        justify-self: end;
    }

    .khmw-tv-main {
        display: flex;
        flex-direction: column;
        height: auto;
    }

    .khmw-left-stage {
        display: flex;
        flex-direction: column;
    }

    .khmw-marquee {
        min-height: 330px;
    }

    .khmw-prize-stage > img {
        max-height: 300px;
    }

    .khmw-wheel-layout {
        grid-template-columns: minmax(0, 1fr) 180px;
        min-height: 620px;
    }
}

@media (max-width: 700px) {
    .khmw-top-game {
        display: flex;
        flex-direction: column;
        padding: 12px;
    }

    .khmw-top-game .khmw-logo {
        width: auto;
        min-width: 0;
        font-size: 34px;
    }

    .khmw-top-game .khmw-controls,
    .khmw-top-game .khmw-top-meta {
        justify-content: center;
    }

    .khmw-scorebar {
        overflow-x: auto;
        justify-content: flex-start;
    }

    .khmw-score-pill {
        flex: 0 0 150px;
    }

    .khmw-tv-main {
        padding-inline: 10px;
    }

    .khmw-marquee {
        min-height: 300px;
        padding: 15px;
        border-radius: 25px;
    }

    .khmw-word-board {
        min-height: 270px;
        padding-inline: 18px;
    }

    .khmw-tile-frame {
        width: 48px;
        height: 76px;
    }

    .khmw-wheel-layout {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .khmw-shell-game .khmw-keyboard {
        width: 100%;
        min-height: 0;
    }

    .khmw-shell-game .khmw-key-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .khmw-shell-game .khmw-key {
        min-height: 44px;
        font-size: 21px;
    }

    .khmw-question-slot {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        margin-top: 10px;
        transform: none;
    }
}


/* 1.7.4: explicit clue above alphabet + host portrait. */
.khmw-side-column {
    direction: rtl;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    width: 100%;
    align-self: start;
}

.khmw-side-column .khmw-riddle-box {
    margin: 0;
    padding: 13px 10px 14px;
    text-align: center;
    background:
        radial-gradient(circle at 50% 0, rgba(255,211,91,.12), transparent 58%),
        linear-gradient(180deg, rgba(15,49,101,.98), rgba(5,18,42,.99));
    border: 2px solid #dfa62d;
    border-radius: 16px;
    box-shadow: 0 10px 22px rgba(0,0,0,.3), inset 0 0 18px rgba(70,135,235,.13), 0 0 18px rgba(224,166,45,.08);
}

.khmw-side-column .khmw-riddle-label {
    color: #ffd85e;
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
}

.khmw-side-column .khmw-riddle-text {
    margin-top: 8px;
    color: #fff;
    font-size: clamp(22px, 1.75vw, 32px);
    font-weight: 900;
    line-height: 1.16;
    overflow-wrap: anywhere;
    text-shadow: 0 2px 0 #081326, 0 0 14px rgba(255,214,102,.2);
}

.khmw-side-column .khmw-riddle-category {
    margin-top: 8px;
    color: #cfe0ff;
    font-size: 12px;
    font-weight: 800;
}

.khmw-shell-game .khmw-side-column .khmw-keyboard {
    width: 100%;
    min-height: 0;
    padding: 10px 9px 11px;
}

.khmw-shell-game .khmw-side-column .khmw-keyboard .khmw-section-title {
    margin-bottom: 8px;
    padding-bottom: 7px;
    font-size: 17px;
}

.khmw-shell-game .khmw-side-column .khmw-key-grid {
    gap: 6px;
}

.khmw-shell-game .khmw-side-column .khmw-key {
    min-height: 45px;
    font-size: clamp(18px, 1.45vw, 25px);
}

.khmw-host-card {
    position: relative;
    width: min(100%, 180px);
    margin: 0 auto;
    overflow: hidden;
    background: #06152f;
    border: 2px solid #d9a02c;
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(0,0,0,.36), 0 0 18px rgba(221,162,38,.1);
}

.khmw-host-card img {
    display: block;
    width: 100%;
    aspect-ratio: 325 / 350;
    object-fit: cover;
    object-position: 50% 18%;
    filter: saturate(.88) contrast(1.03);
    user-select: none;
    pointer-events: none;
}

.khmw-host-name {
    position: absolute;
    right: 8px;
    bottom: 8px;
    left: 8px;
    padding: 5px 7px;
    color: #ffe17a;
    font-size: 13px;
    font-weight: 900;
    text-align: center;
    background: rgba(3,14,34,.84);
    border: 1px solid rgba(224,166,45,.62);
    border-radius: 999px;
    backdrop-filter: blur(3px);
}

@media (max-width: 1100px) {
    .khmw-host-card {
        width: min(100%, 150px);
    }

    .khmw-side-column .khmw-riddle-text {
        font-size: 21px;
    }
}

@media (max-width: 760px) {
    .khmw-host-card {
        width: 150px;
    }
}
