#game-root {
    --h-accent: #10B981;
    --h-accent-dark: #0e9c6f;
    --h-accent-light: #e3f9ef;
    --h-accent-border: #a7f3d0;
    --h-cell-bg: #f4f9f7;
    --h-cell-border: #d7e8e1;
    border-radius: var(--kw-radius, 16px);
}

.kwg-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 14px;
}

.h-wrap {
    max-width: 480px;
    margin: 0 auto;
}

.h-loading,
.h-error {
    text-align: center;
    padding: 48px 16px;
}

.h-loading-icon,
.h-error-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.h-loading-icon {
    animation: h-pulse 1.2s ease-in-out infinite;
}

.h-loading-text {
    font-size: 15px;
    color: #666;
}

.h-error-text {
    font-size: 15px;
    font-weight: 700;
    color: #EF4444;
}

.h-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 18px;
}

.h-header-icon {
    display: flex;
    font-size: 30px;
    line-height: 1;
}

.h-header-icon img {
    display: block;
    height: 38px;
    width: auto;
}

.h-header-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--h-accent);
}

.h-levels {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.h-level-card {
    display: flex;
    flex-direction: column;
    border: none;
    border-radius: var(--kw-radius, 16px);
    background: #fff;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
    transition: transform .15s ease, box-shadow .15s ease;
}

.h-level-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 18px rgba(0, 0, 0, .14);
}

.h-level-card:active {
    transform: translateY(-1px);
}

.h-level-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 88px;
    font-size: 36px;
    background: linear-gradient(135deg, var(--h-accent-light), var(--h-accent-border));
    background-size: 88px 88px;
    background-repeat: no-repeat;
    background-position: center;
}

.h-level-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 10px 16px;
}

.h-level-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--kw-text, #2D2A32);
    text-align: center;
}

.h-level-age {
    font-size: 12px;
    font-weight: 700;
    color: var(--h-accent-dark);
    background: var(--h-accent-light);
    padding: 2px 10px;
    border-radius: 999px;
}

.h-level-row {
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.h-level-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--h-accent-light);
    color: var(--h-accent-dark);
    border-radius: 999px;
    padding: 5px 12px;
    font-weight: 700;
    font-size: 12px;
}

.h-level-pill-icon {
    display: inline-flex;
    line-height: 1;
}

.h-level-pill-icon img {
    display: block;
    width: 14px;
    height: 14px;
    object-fit: cover;
    border-radius: 50%;
}

.h-change-level-btn {
    border: none;
    background: none;
    color: var(--h-accent-dark);
    text-decoration: underline;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    padding: 4px;
}

.h-change-level-btn:hover {
    color: var(--h-accent);
}

.h-stat-row {
    justify-content: center;
    margin-bottom: 6px;
}

.h-stat {
    background: var(--h-accent-light);
    color: var(--h-accent-dark);
    border-radius: 999px;
    padding: 6px 14px;
    font-weight: 700;
    font-size: 14px;
}

.h-board-wrap {
    position: relative;
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
}

.h-nono-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--h-accent-dark);
    letter-spacing: .02em;
    margin: 6px 0 10px;
}

.h-nono-grid {
    display: grid;
    width: 100%;
    background: var(--h-cell-border);
    border: 2px solid var(--h-cell-border);
    border-radius: 10px;
    overflow: hidden;
    gap: 1px;
    animation: h-fade-in .25s ease;
}

.h-nono-corner {
    background: #fff;
}

.h-nono-clue {
    display: flex;
    background: #fff;
    color: var(--kw-text, #2D2A32);
    font-weight: 700;
    line-height: 1.05;
    transition: background .15s ease, color .15s ease;
}

.h-nono-clue-col {
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 1px;
    min-height: 36px;
    font-size: 11px;
    padding: 3px 1px 4px;
}

.h-nono-clue-row {
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    min-width: 36px;
    font-size: 12px;
    padding: 0 8px 0 4px;
    white-space: nowrap;
}

.h-nono-clue-done {
    background: var(--h-accent-light);
    color: var(--h-accent-dark);
    opacity: .55;
}

.h-nono-cell {
    width: 100%;
    aspect-ratio: 1 / 1;
    border: none;
    background: var(--h-cell-bg);
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: #94a3b8;
    transition: background .12s ease, transform .1s ease;
    -webkit-tap-highlight-color: transparent;
}

.h-nono-cell:hover {
    background: var(--h-accent-border);
}

.h-nono-cell-filled {
    background: var(--h-accent);
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12), inset 0 2px 0 rgba(255, 255, 255, .25);
}

.h-nono-cell-filled:hover {
    background: var(--h-accent-dark);
}

.h-nono-cell-marked {
    color: #94a3b8;
}

.h-nono-cell-hint {
    animation: h-hint-glow 1s ease-in-out 2;
    box-shadow: inset 0 0 0 2px #F59E0B;
}

.h-nono-block-left {
    box-shadow: inset 1px 0 0 var(--h-accent-border, #2D2A32);
}

.h-nono-block-top {
    box-shadow: inset 0 1px 0 var(--h-accent-border, #2D2A32);
}

/* A cell at a 3x3 intersection (e.g. row 3 + col 3) carries both classes —
   box-shadow isn't additive across separate rules, so the combo needs its
   own rule listing both shadows together, or one of them would just get
   silently overridden by the other. */
.h-nono-block-top.h-nono-block-left {
    box-shadow: inset 1px 0 0 var(--h-accent-border, #2D2A32), inset 0 1px 0 var(--h-accent-border, #2D2A32);
}

.h-hint-row {
    justify-content: center;
    margin-top: 18px;
    margin-bottom: 0;
}

.h-hint-btn {
    border: none;
    background: var(--h-accent-light);
    color: var(--h-accent-dark);
    border-radius: 999px;
    padding: 8px 16px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: transform .1s ease, background .15s ease;
}

.h-hint-btn:hover:not(:disabled) {
    background: var(--h-accent-border);
    transform: translateY(-1px);
}

.h-hint-btn:disabled {
    opacity: .45;
    cursor: default;
}

.h-done-card {
    text-align: center;
    background: #fff;
    border-radius: var(--kw-radius, 16px);
    padding: 32px 20px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .07);
    animation: h-pop .3s ease;
}

.h-done-emoji {
    font-size: 56px;
    margin-bottom: 8px;
}

.h-done-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--h-accent-dark);
    margin-bottom: 6px;
}

.h-done-score {
    font-size: 16px;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
}

.h-done-meta {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.h-done-meta-item {
    background: var(--h-accent-light);
    color: var(--h-accent-dark);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
}

.h-done-stars {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    font-size: 24px;
}

.h-done-share {
    justify-content: center;
    margin-top: 16px;
}

.h-done-actions {
    justify-content: center;
    margin-top: 20px;
}

.h-btn-primary,
.h-btn-secondary {
    border: none;
    padding: 12px 22px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: transform .1s ease;
}

.h-btn-primary {
    background: var(--h-accent);
    color: #fff;
    box-shadow: 0 3px 0 var(--h-accent-dark);
}

.h-btn-primary:hover {
    transform: translateY(-1px);
}

.h-btn-secondary {
    background: var(--h-accent-light);
    color: var(--h-accent-dark);
}

.h-btn-secondary:hover {
    background: var(--h-accent-border);
}

@keyframes h-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes h-pop {
    0% { transform: scale(.85); }
    100% { transform: scale(1); }
}

@keyframes h-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: .7; }
}

@keyframes h-hint-glow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.6); }
}

@media (max-width: 380px) {
    .h-levels {
        grid-template-columns: 1fr;
    }
}
