/* WORDLE - ULTRA COMPACT - KEYBOARD ALWAYS VISIBLE */
:root {
    --font-main: 'Outfit', sans-serif;
    --bg-color: #f5f3ff;
    --text-color: #4c1d95;
    --accent-color: #7c3aed;
    --accent-glow: rgba(124, 58, 237, 0.4);
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 8px 32px rgba(124, 58, 237, 0.1);
    --key-bg: #ede9fe;
    --key-text: #5b21b6;
    --color-correct: #22c55e;
    --color-present: #eab308;
    --color-absent: #94a3b8;
    --text-on-color: #fff;
    --blob-1: #ddd6fe;
    --blob-2: #a78bfa
}

body.dark {
    --bg-color: #0f172a;
    --text-color: #f5f3ff;
    --accent-color: #8b5cf6;
    --accent-glow: rgba(139, 92, 246, 0.5);
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --key-bg: #1e293b;
    --key-text: #f1f5f9;
    --blob-1: #4c1d95;
    --blob-2: #5b21b6
}

body[data-theme="dark"] {
    --bg-color: #111827;
    --text-color: #f9fafb;
    --accent-color: #6b7280;
    --accent-glow: rgba(107, 114, 128, 0.4);
    --glass-bg: rgba(31, 41, 55, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    --key-bg: #1f2937;
    --key-text: #e5e7eb;
    --blob-1: #374151;
    --blob-2: #4b5563
}

body[data-theme="sunset"] {
    --bg-color: #fff7ed;
    --text-color: #7c2d12;
    --accent-color: #ea580c;
    --accent-glow: rgba(234, 88, 12, 0.4);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --key-bg: #ffedd5;
    --key-text: #9a3412;
    --blob-1: #fdba74;
    --blob-2: #fb923c
}

body[data-theme="dandelion"] {
    --bg-color: #f0f9ff;
    --text-color: #0c4a6e;
    --accent-color: #0ea5e9;
    --accent-glow: rgba(14, 165, 233, 0.4);
    --glass-bg: rgba(255, 255, 255, 0.6);
    --key-bg: #e0f2fe;
    --key-text: #0369a1;
    --blob-1: #bae6fd;
    --blob-2: #7dd3fc
}

body[data-theme="cyber"] {
    --bg-color: #000;
    --text-color: #0f0;
    --accent-color: #f0f;
    --accent-glow: rgba(255, 0, 255, 0.6);
    --glass-bg: rgba(20, 20, 20, 0.8);
    --glass-border: rgba(0, 255, 0, 0.3);
    --glass-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
    --key-bg: #111;
    --key-text: #0f0;
    --blob-1: #f0f;
    --blob-2: #0ff;
    --font-main: 'Courier New', monospace
}

body[data-theme="liquid"] {
    --bg-color: rgba(255, 255, 255, 0.95);
    --text-color: #1f2937;
    --accent-color: rgba(59, 130, 246, 0.8);
    --accent-glow: rgba(59, 130, 246, 0.2);
    --glass-bg: rgba(255, 255, 255, 0.3);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    --key-bg: rgba(255, 255, 255, 0.4);
    --key-text: #374151;
    --blob-1: rgba(147, 197, 253, 0.4);
    --blob-2: rgba(96, 165, 250, 0.4)
}

body[data-theme="liquid"] .cell,
body[data-theme="liquid"] .btn,
body[data-theme="liquid"] input,
body[data-theme="liquid"] .key {
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%)
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main), -apple-system, sans-serif;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: background-color .5s ease, color .5s ease;
    position: relative
}

.background-anim {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none
}

.background-anim::before,
.background-anim::after {
    content: '';
    position: absolute;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .6;
    animation: floatBlob 10s infinite alternate ease-in-out
}

.background-anim::before {
    background: var(--blob-1);
    top: -10%;
    left: -10%
}

.background-anim::after {
    background: var(--blob-2);
    bottom: -10%;
    right: -10%;
    animation-delay: -5s
}

@keyframes floatBlob {
    0% {
        transform: translate(0, 0) scale(1)
    }

    100% {
        transform: translate(20px, 40px) scale(1.1)
    }
}

.app {
    width: 100%;
    max-width: 480px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 55px 15px 0;
    position: relative;
    z-index: 1;
    overflow: hidden
}

h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--accent-color), var(--blob-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 2px 10px var(--accent-glow));
    animation: titlePop .6s cubic-bezier(.175, .885, .32, 1.275)
}

@keyframes titlePop {
    0% {
        transform: scale(.8);
        opacity: 0
    }

    100% {
        transform: scale(1);
        opacity: 1
    }
}

.section {
    display: none;
    width: 100%;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: slideUp .4s cubic-bezier(.16, 1, .3, 1);
    padding-bottom: 5px
}

.section.active {
    display: flex
}

#screen-game {
    justify-content: flex-start;
    padding-bottom: 25px;
    position: relative
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

label {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-color);
    display: block
}

#screen-mode p {
    font-size: 1.4rem;
    font-weight: 300;
    margin-bottom: 18px
}

#playerLabel {
    font-weight: 800;
    color: var(--accent-color)
}

.avatar-carousel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 8px 0 15px
}

.avatar-display {
    font-size: 3.5rem;
    width: 90px;
    height: 90px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: transform .3s ease
}

.nav-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glass-shadow);
    transition: all .2s
}

.nav-btn:hover {
    transform: scale(1.1);
    background: var(--accent-color);
    color: #fff
}

.nav-btn:active {
    transform: scale(.95)
}

input {
    width: 100%;
    max-width: 300px;
    padding: 13px;
    border-radius: 18px;
    border: 2px solid rgba(150, 150, 150, .2);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    color: var(--text-color);
    font-size: 1.1rem;
    text-align: center;
    font-weight: 600;
    outline: none;
    transition: all .3s ease;
    box-shadow: var(--glass-shadow);
    margin-bottom: 6px
}

input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px var(--accent-glow);
    transform: translateY(-2px)
}

.btn {
    width: 100%;
    max-width: 300px;
    padding: 13px;
    margin-top: 10px;
    border-radius: 18px;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    background: var(--accent-color);
    color: #fff;
    box-shadow: 0 4px 15px var(--accent-glow);
    transition: all .2s cubic-bezier(.4, 0, .2, 1);
    position: relative;
    overflow: hidden
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255, 255, 255, .2), transparent);
    opacity: 0;
    transition: opacity .2s
}

.btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px var(--accent-glow)
}

.btn:hover::after {
    opacity: 1
}

.btn:active {
    transform: scale(.96)
}

.btn.secondary {
    background: var(--key-bg);
    color: var(--text-color);
    box-shadow: none
}

.input-with-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 300px;
    margin-bottom: 8px
}

.input-with-btn input {
    flex: 1;
    margin-bottom: 0
}

.btn-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    border: none;
    background: var(--accent-color);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px var(--accent-glow);
    transition: all .2s;
    flex-shrink: 0
}

.btn-icon:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px var(--accent-glow)
}

.btn-icon:active {
    transform: scale(.95)
}

.board {
    display: grid;
    gap: 4px;
    margin-bottom: 4px;
    margin-top: 6vh;
    /* Move board down */
}

.row {
    display: flex;
    gap: 4px
}

.cell {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    border: 2px solid var(--key-bg);
    background: var(--glass-bg);
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    user-select: none;
    transition: transform .4s, background-color .3s, border-color .3s;
    backdrop-filter: blur(4px)
}

.cell.flip {
    animation: flipTile .5s ease forwards
}

@keyframes flipTile {
    0% {
        transform: rotateX(0)
    }

    50% {
        transform: rotateX(90deg)
    }

    100% {
        transform: rotateX(0)
    }
}

.cell.correct,
.key.correct {
    background-color: var(--color-correct) !important;
    border-color: var(--color-correct) !important;
    color: var(--text-on-color) !important
}

.cell.present,
.key.present {
    background-color: var(--color-present) !important;
    border-color: var(--color-present) !important;
    color: var(--text-on-color) !important
}

.cell.absent,
.key.absent {
    background-color: var(--color-absent) !important;
    border-color: var(--color-absent) !important;
    color: var(--text-on-color) !important
}

.row.win .cell {
    animation: bounce .6s ease infinite
}

.row.win .cell:nth-child(2) {
    animation-delay: .1s
}

.row.win .cell:nth-child(3) {
    animation-delay: .2s
}

.row.win .cell:nth-child(4) {
    animation-delay: .3s
}

.row.win .cell:nth-child(5) {
    animation-delay: .4s
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-10px)
    }
}

.keyboard {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 0 3px;
    margin-top: auto;
    margin-bottom: 0
}

.kb-row {
    display: flex;
    justify-content: center;
    gap: 4px
}

.key {
    flex: 1;
    height: 48px;
    border-radius: 6px;
    background: var(--key-bg);
    color: var(--key-text);
    font-size: .95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: all .15s ease;
    box-shadow: 0 2px 0 rgba(0, 0, 0, .1)
}

.key.big {
    flex: 1.5;
    font-size: .85rem
}

.key:active {
    transform: translateY(2px);
    box-shadow: none
}

.brand-footer {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: .6rem;
    font-weight: 600;
    letter-spacing: .3px;
    text-transform: uppercase;
    opacity: .3;
    pointer-events: none;
    white-space: nowrap
}

.challenge-info {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 6px 12px;
    border-radius: 10px;
    margin-bottom: 4px;
    font-weight: 600;
    box-shadow: var(--glass-shadow);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .8rem
}

.challenge-info::before {
    content: '⚔️';
    font-size: .9rem
}

.status {
    min-height: 14px;
    font-weight: 600;
    margin: 3px 0;
    font-size: .8rem
}

@media(max-height:800px) {
    .app {
        padding: 52px 12px 0
    }

    h1 {
        font-size: 1.6rem;
        margin-bottom: 6px
    }

    .cell {
        width: 40px;
        height: 40px;
        font-size: 1.4rem
    }

    .board {
        gap: 3px;
        margin-bottom: 3px;
        margin-top: 2vh;
    }

    .row {
        gap: 3px
    }

    .key {
        height: 46px;
        font-size: .9rem
    }

    .kb-row {
        gap: 3px
    }

    .keyboard {
        gap: 4px
    }

    .challenge-info {
        padding: 5px 10px;
        font-size: .75rem;
        margin-bottom: 3px
    }

    .status {
        margin: 2px 0;
        font-size: .75rem
    }
}

@media(max-height:740px) {
    .app {
        padding: 50px 10px 0
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 5px
    }

    .cell {
        width: 38px;
        height: 38px;
        font-size: 1.3rem
    }

    .board {
        gap: 3px;
        margin-bottom: 3px;
        margin-top: 1vh;
    }

    .row {
        gap: 3px
    }

    .key {
        height: 44px;
        font-size: .85rem
    }

    .key.big {
        font-size: .75rem
    }

    .kb-row {
        gap: 3px
    }

    .keyboard {
        gap: 4px
    }

    .challenge-info {
        padding: 4px 8px;
        font-size: .7rem;
        margin-bottom: 2px
    }

    .status {
        margin: 2px 0;
        font-size: .7rem
    }

    .avatar-display {
        font-size: 3rem;
        width: 75px;
        height: 75px
    }

    .nav-btn {
        width: 38px;
        height: 38px
    }
}

@media(max-height:700px) {
    .app {
        padding: 48px 8px 0
    }

    h1 {
        font-size: 1.4rem;
        margin-bottom: 4px
    }

    .cell {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
        border-width: 1.5px
    }

    .board {
        gap: 2px;
        margin-bottom: 2px;
        margin-top: 0;
    }

    .row {
        gap: 2px
    }

    .key {
        height: 42px;
        font-size: .8rem
    }

    .key.big {
        font-size: .7rem
    }

    .kb-row {
        gap: 2px
    }

    .keyboard {
        gap: 3px
    }

    .challenge-info {
        padding: 3px 6px;
        font-size: .65rem;
        margin-bottom: 2px
    }

    .status {
        margin: 1px 0;
        font-size: .65rem
    }
}

@media(max-height:667px) {
    .app {
        padding: 46px 6px 0
    }

    h1 {
        font-size: 1.3rem;
        margin-bottom: 3px
    }

    .cell {
        width: 34px;
        height: 34px;
        font-size: 1.1rem;
        border-width: 1px
    }

    .board {
        gap: 2px;
        margin-bottom: 2px
    }

    .row {
        gap: 2px
    }

    .key {
        height: 40px;
        font-size: .75rem
    }

    .key.big {
        font-size: .65rem
    }

    .kb-row {
        gap: 2px
    }

    .keyboard {
        gap: 3px
    }

    .challenge-info {
        padding: 2px 5px;
        font-size: .6rem;
        margin-bottom: 1px
    }

    .status {
        margin: 1px 0;
        font-size: .6rem
    }

    .brand-footer {
        font-size: .55rem
    }
}

@media(max-height:640px) {
    .app {
        padding: 44px 5px 0
    }

    h1 {
        font-size: 1.2rem;
        margin-bottom: 2px
    }

    .cell {
        width: 32px;
        height: 32px;
        font-size: 1rem;
        border-width: 1px
    }

    .board {
        gap: 2px;
        margin-bottom: 1px
    }

    .row {
        gap: 2px
    }

    .key {
        height: 38px;
        font-size: .7rem
    }

    .key.big {
        font-size: .6rem
    }

    .kb-row {
        gap: 2px
    }

    .keyboard {
        gap: 2px
    }

    .challenge-info {
        display: none
    }

    .status {
        margin: 0;
        font-size: .55rem
    }
}

@media(max-height:600px) {
    .app {
        padding: 42px 4px 0
    }

    h1 {
        font-size: 1.1rem;
        margin-bottom: 2px
    }

    .cell {
        width: 30px;
        height: 30px;
        font-size: .95rem;
        border-width: 1px
    }

    .board {
        gap: 1px;
        margin-bottom: 1px
    }

    .row {
        gap: 1px
    }

    .key {
        height: 36px;
        font-size: .65rem
    }

    .key.big {
        font-size: .55rem
    }

    .kb-row {
        gap: 1px
    }

    .keyboard {
        gap: 2px
    }

    .status {
        margin: 0;
        font-size: .5rem
    }
}

.back-btn,
.theme-btn {
    position: fixed;
    top: 12px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glass-shadow);
    transition: transform .2s;
    z-index: 100
}

.back-btn {
    left: 12px
}

.theme-btn {
    right: 12px
}

.back-btn:hover,
.theme-btn:hover {
    transform: scale(1.1)
}

.player-display {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 6px 14px;
    border-radius: 18px;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--glass-shadow);
    transition: transform .2s;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 5px;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.player-display:hover {
    transform: translateX(-50%) scale(1.05)
}

.hidden {
    display: none !important
}

.popup {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 80vh;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    border-radius: 30px 30px 0 0;
    padding: 20px;
    transform: translateY(100%);
    transition: transform .4s cubic-bezier(.16, 1, .3, 1);
    z-index: 200;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, .2);
    text-align: center;
    overflow-y: auto
}

.popup.active {
    transform: translateY(0)
}

.popup-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 6px
}

.popup-meta {
    margin-bottom: 12px;
    opacity: .8;
    font-size: .95rem
}

.link-box {
    background: var(--key-bg);

    .cell {
        width: 32px;
        height: 32px;
        font-size: 1rem;
        border-width: 1px
    }

    .board {
        gap: 2px;
        margin-bottom: 1px
    }

    .row {
        gap: 2px
    }

    .key {
        height: 38px;
        font-size: .7rem
    }

    .key.big {
        font-size: .6rem
    }

    .kb-row {
        gap: 2px
    }

    .keyboard {
        gap: 2px
    }

    .challenge-info {
        display: none
    }

    .status {
        margin: 0;
        font-size: .55rem
    }
}

@media(max-height:600px) {
    .app {
        padding: 42px 4px 0
    }

    h1 {
        font-size: 1.1rem;
        margin-bottom: 2px
    }

    .cell {
        width: 30px;
        height: 30px;
        font-size: .95rem;
        border-width: 1px
    }

    .board {
        gap: 1px;
        margin-bottom: 1px
    }

    .row {
        gap: 1px
    }

    .key {
        height: 36px;
        font-size: .65rem
    }

    .key.big {
        font-size: .55rem
    }

    .kb-row {
        gap: 1px
    }

    .keyboard {
        gap: 2px
    }

    .status {
        margin: 0;
        font-size: .5rem
    }
}

.back-btn,
.theme-btn {
    position: fixed;
    top: 12px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glass-shadow);
    transition: transform .2s;
    z-index: 100
}

.back-btn {
    left: 12px
}

.theme-btn {
    right: 12px
}

.back-btn:hover,
.theme-btn:hover {
    transform: scale(1.1)
}

.player-display {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 6px 14px;
    border-radius: 18px;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--glass-shadow);
    transition: transform .2s;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 5px;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.player-display:hover {
    transform: translateX(-50%) scale(1.05)
}

.hidden {
    display: none !important
}

.popup {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 80vh;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    border-radius: 30px 30px 0 0;
    padding: 20px;
    transform: translateY(100%);
    transition: transform .4s cubic-bezier(.16, 1, .3, 1);
    z-index: 200;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, .2);
    text-align: center;
    overflow-y: auto
}

.popup.active {
    transform: translateY(0)
}

.popup-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 6px
}

.popup-meta {
    margin-bottom: 12px;
    opacity: .8;
    font-size: .95rem
}

.link-box {
    background: var(--key-bg);
    padding: 10px;
    border-radius: 8px;
    font-family: monospace;
    font-size: .8rem;
    margin: 10px 0;
    word-break: break-all;
    background: rgba(0, 0, 0, .05);
}

.theme-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 12px;
    max-width: 100%
}

.theme-option {
    padding: 10px;
    border-radius: 10px;
    border: 2px solid transparent;
    background: rgba(0, 0, 0, .05);
    cursor: pointer;
    font-weight: 700;
    font-size: .9rem;
    transition: all .2s
}


.keyboard {
    gap: 2px
}

.challenge-info {
    display: none
}

.status {
    margin: 0;
    font-size: .55rem
}


@media(max-height:600px) {
    .app {
        padding: 42px 4px 0
    }

    h1 {
        font-size: 1.1rem;
        margin-bottom: 2px
    }

    .cell {
        width: 30px;
        height: 30px;
        font-size: .95rem;
        border-width: 1px
    }

    .board {
        gap: 1px;
        margin-bottom: 1px
    }

    .row {
        gap: 1px
    }

    .key {
        height: 36px;
        font-size: .65rem
    }

    .key.big {
        font-size: .55rem
    }

    .kb-row {
        gap: 1px
    }

    .keyboard {
        gap: 2px
    }

    .status {
        margin: 0;
        font-size: .5rem
    }
}

.back-btn,
.theme-btn {
    position: fixed;
    top: 12px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glass-shadow);
    transition: transform .2s;
    z-index: 100
}

.back-btn {
    left: 12px
}

.theme-btn {
    right: 12px
}

.back-btn:hover,
.theme-btn:hover {
    transform: scale(1.1)
}

.player-display {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 6px 14px;
    border-radius: 18px;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--glass-shadow);
    transition: transform .2s;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 5px;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.player-display:hover {
    transform: translateX(-50%) scale(1.05)
}

.hidden {
    display: none !important
}

.popup {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 80vh;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    border-radius: 30px 30px 0 0;
    padding: 20px;
    transform: translateY(100%);
    transition: transform .4s cubic-bezier(.16, 1, .3, 1);
    z-index: 200;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, .2);
    text-align: center;
    overflow-y: auto
}

.popup.active {
    transform: translateY(0)
}

.popup-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 6px
}

.popup-meta {
    margin-bottom: 12px;
    opacity: .8;
    font-size: .95rem
}

.link-box {
    background: var(--key-bg);
    padding: 10px;
    border-radius: 8px;
    font-family: monospace;
    font-size: .8rem;
    margin: 10px 0;
    word-break: break-all;
    background: rgba(0, 0, 0, .05);
}

.theme-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 12px;
    max-width: 100%
}

.theme-option {
    padding: 10px;
    border-radius: 10px;
    border: 2px solid transparent;
    background: rgba(0, 0, 0, .05);
    cursor: pointer;
    font-weight: 700;
    font-size: .9rem;
    transition: all .2s
}


.keyboard {
    gap: 2px
}

.challenge-info {
    display: none
}

.status {
    margin: 0;
    font-size: .55rem
}


@media(max-height:600px) {
    .app {
        padding: 42px 4px 0
    }

    h1 {
        font-size: 1.1rem;
        margin-bottom: 2px
    }

    .cell {
        width: 30px;
        height: 30px;
        font-size: .95rem;
        border-width: 1px
    }

    .board {
        gap: 1px;
        margin-bottom: 1px;
        margin-top: 0;
    }

    .row {
        gap: 1px
    }

    .key {
        height: 36px;
        font-size: .65rem
    }

    .key.big {
        font-size: .55rem
    }

    .kb-row {
        gap: 1px
    }

    .keyboard {
        gap: 2px
    }

    .status {
        margin: 0;
        font-size: .5rem
    }
}

.back-btn,
.theme-btn {
    position: fixed;
    top: 12px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glass-shadow);
    transition: transform .2s;
    z-index: 100
}

.back-btn {
    left: 12px
}

.theme-btn {
    right: 12px
}

.back-btn:hover,
.theme-btn:hover {
    transform: scale(1.1)
}

.theme-option:hover {
    transform: scale(1.05);
    background: rgba(0, 0, 0, .1)
}

.theme-option.active {
    border-color: var(--accent-color);
    background: var(--accent-glow)
}

/* Cleaned up utility classes */
.key {
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    position: relative;
    z-index: 10;
}

input,
button {
    touch-action: manipulation;
}

/* Install Button */
.install-btn {
    position: fixed;
    top: 12px;
    right: 60px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glass-shadow);
    transition: transform .2s;
    z-index: 100;
}

.install-btn:hover {
    transform: scale(1.1);
}