/* file: public_html/assets/css/style.css */

:root {
    --bg-dark: #0a0f1e;
    --card-bg: #0f172a;
    --card-bg-soft: #111b34;
    --primary-cyan: #00f3ff;
    --primary-pink: #ff007c;
    --primary-yellow: #ffe600;
    --primary-green: #10b981;
    --primary-red: #ff4d6d;
    --text-main: #f8fafc;
    --text-gray: #cbd5e1;
    --text-soft: #94a3b8;
    --shadow-px: 4px;
    --border-soft: rgba(255,255,255,0.08);
    --success-glow: 0 0 18px rgba(16,185,129,0.35);
    --danger-glow: 0 0 18px rgba(255,77,109,0.35);
    --cyanglow: 0 0 18px rgba(0,243,255,0.28);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
*::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.65;
    background-attachment: fixed;
    background-image:
        linear-gradient(rgba(10, 15, 30, 0.95), rgba(10, 15, 30, 0.95)),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.4) 2px, rgba(0,0,0,0.4) 4px);
    background-size: 100% 4px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

body.modal-open,
body.menu-open,
body.game-open {
    overflow: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
[hidden] { display: none !important; }

h1, h2, h3, .pixel-font {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}

.btn-pixel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 800;
    font-size: 13px;
    line-height: 1.3;
    padding: 12px 20px;
    border: 3px solid #fff;
    background: var(--card-bg);
    color: #fff;
    text-decoration: none;
    box-shadow: var(--shadow-px) var(--shadow-px) 0 #000;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.18s ease;
    user-select: none;
    text-align: center;
    border-radius: 10px;
}

.btn-pixel:hover { filter: brightness(1.08); }

.btn-pixel:active {
    transform: translate(var(--shadow-px), var(--shadow-px));
    box-shadow: 0 0 0 #000;
}

.btn-pixel:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    filter: none;
}

.btn-primary {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
    box-shadow: var(--shadow-px) var(--shadow-px) 0 var(--primary-cyan);
    text-shadow: 0 0 5px var(--primary-cyan);
}

.btn-secondary {
    border-color: #ff4da0;
    color: #ff5fb0;
    box-shadow: var(--shadow-px) var(--shadow-px) 0 #ff2f96;
    text-shadow: 0 0 4px rgba(255,95,176,0.28);
}

.btn-success {
    border-color: var(--primary-green);
    color: var(--primary-green);
    box-shadow: var(--shadow-px) var(--shadow-px) 0 var(--primary-green);
    text-shadow: 0 0 5px var(--primary-green);
}

.btn-warning {
    border-color: #ffe600;
    color: #fff07a;
    box-shadow: var(--shadow-px) var(--shadow-px) 0 #ffd400;
    text-shadow: 0 0 4px rgba(255,240,122,0.24);
}

header {
    background: rgba(10, 15, 30, 0.94);
    backdrop-filter: blur(8px);
    border-bottom: 2px solid rgba(255,255,255,0.05);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    gap: 14px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.logo-area > span {
    font-size: 34px;
    line-height: 1;
    filter: drop-shadow(0 0 8px rgba(0,243,255,0.22));
    flex: 0 0 auto;
}

.logo-text {
    min-width: 0;
}

.logo-text strong {
    display: block;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 800;
    font-size: 22px;
    line-height: 1.1;
    color: var(--primary-cyan);
    text-transform: none;
    letter-spacing: 0.01em;
}

.logo-text span {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    font-weight: 700;
    color: #ff70ba;
    letter-spacing: 0.01em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.user-avatar-btn {
    min-width: 44px;
    min-height: 44px;
    font-size: 24px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 6px 10px;
    border: 2px solid var(--primary-green);
}

.nav-desktop {
    display: flex;
    gap: 6px;
    align-items: center;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-gray);
    padding: 10px 12px;
    cursor: pointer;
    border: 2px solid transparent;
    background: none;
    border-radius: 8px;
    line-height: 1.2;
}

.nav-btn.active,
.nav-btn:hover {
    color: var(--primary-yellow);
    border-color: var(--primary-yellow);
    background: rgba(255,230,0,0.1);
}

.menu-toggle {
    display: none;
    min-width: 44px;
    min-height: 44px;
    font-size: 24px;
    background: none;
    border: none;
    color: var(--primary-cyan);
    cursor: pointer;
}

.auth-buttons {
    display: flex;
    gap: 10px;
    margin-left: 10px;
}

main { padding: 44px 0 40px; }

.page-box {
    background: linear-gradient(180deg, rgba(15,23,42,0.97), rgba(17,27,52,0.97));
    border: 2px solid rgba(255,255,255,0.05);
    padding: 24px;
    margin-bottom: 28px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

main > .page-box:first-child {
    margin-top: 18px;
}

.section-title {
    font-size: 20px;
    color: #fff;
    text-shadow: 0 0 8px var(--primary-cyan);
    border-bottom: 2px dashed rgba(255,255,255,0.1);
    padding-bottom: 10px;
    margin-bottom: 18px;
}

.section-title.no-border {
    border-bottom: none;
    padding-bottom: 0;
}

.breadcrumb {
    font-size: 13px;
    margin-top: 6px;
    margin-bottom: 20px;
    color: var(--text-gray);
    background: rgba(0,0,0,0.3);
    padding: 12px 14px;
    border-radius: 10px;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    line-height: 1.5;
}

.breadcrumb span.sep {
    margin: 0 6px;
    color: var(--primary-pink);
}

.breadcrumb a {
    display: inline;
    min-height: 0;
    padding: 0;
}

.breadcrumb a:hover {
    color: var(--primary-cyan);
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.pixel-input,
.pixel-select {
    flex: 1;
    min-height: 50px;
    padding: 12px 14px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 700;
    font-size: 14px;
    background: rgba(0,0,0,0.5);
    border: 2px solid var(--text-gray);
    color: #fff;
    border-radius: 10px;
    min-width: 180px;
}

.pixel-input::placeholder,
.pixel-select::placeholder {
    color: rgba(203,213,225,0.72);
}

.pixel-input:focus,
.pixel-select:focus {
    outline: none;
    border-color: var(--primary-cyan);
    box-shadow: var(--cyanglow);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.84);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding:
        max(16px, env(safe-area-inset-top))
        max(16px, env(safe-area-inset-right))
        max(16px, env(safe-area-inset-bottom))
        max(16px, env(safe-area-inset-left));
}

.modal-overlay.active { display: flex; }

.modal-content {
    background: var(--card-bg);
    border: 4px solid var(--primary-pink);
    padding: 28px 24px;
    border-radius: 18px;
    width: 100%;
    max-width: 460px;
    position: relative;
    z-index: 10000;
    max-height: min(90dvh, 720px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 800;
    color: var(--primary-pink);
    cursor: pointer;
    font-size: 20px;
    border: 0;
    background: transparent;
    line-height: 1;
}

.modal-title {
    font-size: 18px;
    margin-bottom: 20px;
    text-align: center;
}

.modal-title.cyan { color: var(--primary-cyan); }
.modal-title.pink { color: var(--primary-pink); }

.label-mini {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 800;
    font-size: 12px;
    color: var(--text-gray);
    display: block;
    margin-bottom: 10px;
}

.label-mini.yellow { color: var(--primary-yellow); }

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
    gap: 10px;
    margin: 15px 0 20px;
}

.avatar-item {
    min-height: 52px;
    font-size: 30px;
    text-align: center;
    background: rgba(255,255,255,0.05);
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 5px;
    cursor: pointer;
}

.avatar-item.selected {
    border-color: var(--primary-green);
    background: rgba(16,185,129,0.2);
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.tab-btn {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 800;
    font-size: 12px;
    padding: 12px 15px;
    background: rgba(0,0,0,0.5);
    border: 2px solid var(--text-gray);
    color: var(--text-gray);
    cursor: pointer;
    white-space: nowrap;
    border-radius: 10px;
}

.tab-btn.active {
    border-color: var(--primary-yellow);
    color: var(--primary-yellow);
}

.score-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    text-align: left;
}

.score-table th,
.score-table td {
    vertical-align: middle;
}

.score-table th {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 800;
    font-size: 11px;
    color: #ff75bc;
    padding: 10px 6px;
    border-bottom: 2px dashed rgba(255,255,255,0.1);
    line-height: 1.4;
    white-space: nowrap;
}

.score-table td {
    padding: 12px 6px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    line-height: 1.5;
    font-size: 14px;
    word-break: break-word;
}

.score-table a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 4px 0;
    min-width: 0;
    max-width: 100%;
}

.score-table a:hover {
    color: var(--primary-cyan);
}

.score-table th:nth-child(1),
.score-table td:nth-child(1) {
    width: 40px;
    text-align: center;
}

.score-table th:nth-child(2),
.score-table td:nth-child(2) {
    width: auto;
}

.score-table th:nth-child(3),
.score-table td:nth-child(3),
.score-table th:nth-child(4),
.score-table td:nth-child(4),
.score-table th:nth-child(5),
.score-table td:nth-child(5) {
    width: 64px;
    text-align: center;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.profile-avatar-wrap {
    position: relative;
    font-size: 80px;
    background: rgba(255,255,255,0.05);
    border: 4px solid var(--primary-cyan);
    border-radius: 16px;
    padding: 10px 16px;
}

.edit-avatar-badge {
    position: absolute;
    bottom: -10px;
    right: -10px;
    background: var(--primary-pink);
    border: 2px solid #fff;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
}

.profile-info h1 {
    font-size: 24px;
    color: var(--primary-yellow);
    margin-bottom: 8px;
    text-transform: none;
    letter-spacing: 0.01em;
}

.profile-rank {
    font-size: 13px;
    color: var(--primary-green);
    font-weight: bold;
    background: rgba(16,185,129,0.1);
    padding: 6px 10px;
    border-radius: 6px;
    display: inline-block;
}

.profile-sub {
    margin-top: 10px;
    color: var(--text-gray);
    font-weight: 700;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.stat-box {
    background: rgba(0,0,0,0.4);
    border: 2px solid rgba(255,255,255,0.1);
    padding: 16px 14px;
    text-align: center;
    border-radius: 10px;
}

.stat-box span {
    font-size: 12px;
    color: var(--text-gray);
    font-weight: bold;
    display: block;
    margin-bottom: 6px;
    line-height: 1.4;
}

.stat-box strong {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 800;
    font-size: 18px;
    color: var(--primary-cyan);
    line-height: 1.4;
    word-break: break-word;
}

.list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.data-list {
    list-style: none;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 15px;
}

.data-list h3 {
    font-size: 12px;
    color: var(--primary-pink);
    margin-bottom: 15px;
    border-bottom: 1px dashed rgba(255,255,255,0.2);
    padding-bottom: 10px;
}

.data-list li {
    font-size: 14px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    line-height: 1.5;
}

.data-list li:last-child { border-bottom: none; }

.archive-scroller {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-pink) var(--bg-dark);
}

.archive-card {
    flex: 0 0 220px;
    background: rgba(255,255,255,0.03);
    border: 2px solid rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 12px;
    transition: 0.2s;
}

.archive-card:hover {
    border-color: var(--primary-cyan);
    transform: translateY(-3px);
}

.archive-card h3 {
    line-height: 1.5;
    margin-bottom: 6px;
    font-size: 18px;
}

.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}

.member-card {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 15px;
    text-align: center;
    border-radius: 10px;
    transition: 0.2s;
}

.member-card:hover {
    border-color: var(--primary-yellow);
    transform: translateY(-2px);
}

.dict-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.dict-item {
    background: rgba(255,255,255,0.03);
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-cyan);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.dict-word {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 800;
    font-size: 15px;
    color: var(--text-main);
    line-height: 1.4;
}

.dict-hint {
    font-size: 15px;
    color: var(--text-gray);
    font-weight: bold;
    line-height: 1.5;
}

.badge-line {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.tiny-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border-radius: 999px;
    padding: 6px 10px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 800;
    font-size: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    line-height: 1.2;
}

.tiny-badge.level-A1 { color: #7efc93; border-color: #7efc93; }
.tiny-badge.level-A2 { color: var(--primary-cyan); border-color: var(--primary-cyan); }
.tiny-badge.level-B1 { color: #7da8ff; border-color: #7da8ff; }
.tiny-badge.level-B2 { color: #d787ff; border-color: #d787ff; }
.tiny-badge.level-C1 { color: var(--primary-pink); border-color: var(--primary-pink); }

.pagination {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.page-link {
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.page-link.active,
.page-link:hover {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
}

.page-ellipsis { pointer-events:none; opacity:.72; }

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin: 24px 0;
}

.level-card {
    background: rgba(255,255,255,0.03);
    border: 2px solid rgba(255,255,255,0.10);
    border-radius: 14px;
    padding: 18px 14px;
    cursor: pointer;
    transition: 0.18s ease;
    text-align: center;
}

.level-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.level-card p {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-gray);
    line-height: 1.5;
}

.level-card small {
    display: block;
    margin-top: 10px;
    font-weight: 800;
    font-size: 13px;
    line-height: 1.5;
}

.level-card.active,
.level-card:hover {
    transform: translateY(-3px);
}

.level-card.level-A1.active,
.level-card.level-A1:hover { border-color: #7efc93; box-shadow: 0 0 18px rgba(126,252,147,0.18); }
.level-card.level-A2.active,
.level-card.level-A2:hover { border-color: var(--primary-cyan); box-shadow: var(--cyanglow); }
.level-card.level-B1.active,
.level-card.level-B1:hover { border-color: #7da8ff; box-shadow: 0 0 18px rgba(125,168,255,0.22); }
.level-card.level-B2.active,
.level-card.level-B2:hover { border-color: #d787ff; box-shadow: 0 0 18px rgba(215,135,255,0.22); }
.level-card.level-C1.active,
.level-card.level-C1:hover { border-color: var(--primary-pink); box-shadow: 0 0 18px rgba(255,0,124,0.22); }

.play-route-page {
    min-height: 100vh;
    min-height: 100svh;
    background:
        radial-gradient(circle at top, rgba(0,243,255,0.10), transparent 38%),
        #050811;
}

.game-route-main {
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
}

.level-grid-preview .level-card-preview {
    cursor: default;
}

.play-level-modal-content {
    max-width: 560px;
}

.level-grid-modal {
    margin-top: 16px;
}

.play-level-card {
    text-decoration: none;
    display: block;
}

.game-route-screen {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: max(100svh, var(--game-viewport-height, 100svh));
    padding:
        max(10px, env(safe-area-inset-top))
        max(10px, env(safe-area-inset-right))
        max(14px, env(safe-area-inset-bottom))
        max(10px, env(safe-area-inset-left));
    overflow: visible;
    display: block;
}

.game-route-screen.active {
    display: block;
}

.game-route-screen .game-shell {
    max-width: 760px;
}

.game-back-link {
    width: auto;
}

.level-strip {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.level-chip {
    min-height: 36px;
    padding: 8px 12px;
    border: 2px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 800;
    font-size: 11px;
    line-height: 1.2;
}

.level-chip.active {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
}

.game-fullscreen {
    position: fixed;
    inset: 0;
    width: 100vw;
    min-height: 100dvh;
    z-index: 200;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background:
        radial-gradient(circle at top, rgba(0,243,255,0.10), transparent 38%),
        rgba(5, 8, 17, 0.98);
    display: none;
    padding:
        max(10px, env(safe-area-inset-top))
        max(10px, env(safe-area-inset-right))
        max(10px, env(safe-area-inset-bottom))
        max(10px, env(safe-area-inset-left));
}

.game-fullscreen.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-shell {
    position: relative;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 12px;
}

.game-ad {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 74px;
    padding: 10px 12px;
    border: 2px dashed rgba(255,255,255,0.16);
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
}

.game-ad-slot {
    width: min(100%, 320px);
    min-height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    border-radius: 12px;
    padding: 6px 10px;
}

.game-ad-slot-placeholder {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.08);
}

.game-ad-slot-live {
    width: 100%;
}

.game-ad-slot-live > * {
    margin-left: auto;
    margin-right: auto;
}

.game-brand-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
}

.game-brand-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 2px 0;
}

.game-brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 21px;
    flex: 0 0 auto;
}

.game-brand-text-wrap {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.game-brand-title {
    font-size: 14px;
    font-weight: 900;
    color: #fff;
    line-height: 1.3;
}

.game-brand-subtitle {
    font-size: 12px;
    color: var(--text-gray);
    font-weight: 800;
    line-height: 1.4;
}

.game-ad-title {
    color: var(--text-main);
    font-size: 12px;
    font-weight: 900;
}

.game-ad-size {
    color: var(--text-gray);
    font-size: 11px;
    font-weight: 800;
}

.game-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(17,27,52,0.92), rgba(15,23,42,0.96));
}

.game-topbar-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.game-topbar-copy {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.game-topbar-copy strong {
    font-size: 14px;
    color: #fff;
    font-weight: 900;
    line-height: 1.35;
}

.game-topbar-copy span {
    font-size: 12px;
    color: var(--text-gray);
    font-weight: 800;
    line-height: 1.4;
}

.game-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    min-width: 60px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 800;
    font-size: 10px;
    border: 2px solid rgba(255,255,255,0.12);
    flex: 0 0 auto;
    line-height: 1.2;
}

.game-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.game-stat {
    background: rgba(0,0,0,0.35);
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    border: 2px solid rgba(255,255,255,0.08);
}

.game-stat span {
    display: block;
    font-size: 11px;
    color: var(--text-gray);
    font-weight: 800;
    line-height: 1.4;
}

.game-stat strong {
    display: block;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 800;
    font-size: 16px;
    margin-top: 5px;
    line-height: 1.3;
}

.timer-danger strong {
    color: var(--primary-red);
    text-shadow: 0 0 8px rgba(255,77,109,0.4);
}

.game-question-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.game-question-label {
    font-size: 12px;
    font-weight: 900;
    color: var(--primary-cyan);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding-left: 2px;
}

.game-question {
    background: linear-gradient(180deg, rgba(17,27,52,0.96), rgba(15,23,42,0.98));
    border-radius: 16px;
    border: 2px solid rgba(255,255,255,0.08);
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 104px;
    position: relative;
    overflow: hidden;
}

.game-question::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(0,243,255,0.08), transparent 50%, rgba(255,0,124,0.08));
    pointer-events: none;
}

.game-question-word {
    position: relative;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 800;
    font-size: clamp(18px, 3vw, 22px);
    line-height: 1.4;
    word-break: break-word;
    text-shadow: 0 0 10px rgba(255,255,255,0.15);
}

.game-feedback {
    min-height: 22px;
    text-align: center;
    font-weight: 900;
    letter-spacing: 0.02em;
    font-size: 14px;
    line-height: 1.4;
}

.game-feedback.success { color: var(--primary-green); }
.game-feedback.error { color: var(--primary-red); }

.game-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-content: start;
}

.option-btn {
    min-height: 58px;
    border-radius: 12px;
    border: 3px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: #fff;
    font-weight: 900;
    font-size: 16px;
    padding: 12px 14px;
    text-align: left;
    line-height: 1.4;
    transition: transform 0.12s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
    -webkit-appearance: none;
    appearance: none;
}

.option-btn:hover {
    transform: translateY(-1px);
    border-color: var(--primary-cyan);
}

.option-btn.correct {
    border-color: var(--primary-green);
    background: rgba(16,185,129,0.14);
    box-shadow: var(--success-glow);
}

.option-btn.wrong {
    border-color: var(--primary-red);
    background: rgba(255,77,109,0.14);
    box-shadow: var(--danger-glow);
}

.option-btn:disabled { cursor: default; }

.game-bottom {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
}

.game-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.icon-btn {
    min-width: 48px;
    min-height: 48px;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: #fff;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    -webkit-appearance: none;
    appearance: none;
}

.game-top-exit-btn {
    font-size: 20px;
    font-weight: 900;
}

.game-exit {
    position: static;
    right: auto;
    bottom: auto;
    z-index: auto;
}

.game-over-box {
    position: absolute;
    inset: 0;
    background: rgba(4,7,18,0.92);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.game-over-box.active { display: flex; }

.game-over-card {
    width: min(92vw, 420px);
    background: var(--card-bg);
    border: 4px solid var(--primary-pink);
    border-radius: 18px;
    padding: 26px 22px;
    text-align: center;
    box-shadow: 0 18px 60px rgba(0,0,0,0.56);
}

.final-score {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 800;
    font-size: 40px;
    line-height: 1.3;
    color: var(--primary-yellow);
    margin: 18px 0;
    text-shadow: 0 0 12px rgba(255,230,0,0.28);
}

.final-meta {
    color: var(--text-gray);
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 18px;
    line-height: 1.5;
}

.game-over-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.level-note {
    color: var(--text-gray);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.5;
}

.content-copy p {
    margin-bottom: 14px;
    color: var(--text-gray);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.75;
}

.content-copy a:hover { color: var(--primary-cyan); }
.content-copy strong { color: #fff; }

.toast {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 300;
    max-width: min(92vw, 340px);
    padding: 12px 14px;
    border-radius: 12px;
    border: 2px solid var(--primary-cyan);
    background: rgba(10,15,30,0.98);
    box-shadow: 0 18px 50px rgba(0,0,0,0.48);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    transition: opacity 0.2s ease, transform 0.2s ease;
    line-height: 1.5;
}

.toast.hide {
    opacity: 0;
    transform: translateY(10px);
}

.contact-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.contact-form-grid textarea.pixel-input {
    width: 100%;
    min-height: 220px;
    resize: vertical;
    line-height: 1.7;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    padding: 16px;
}

.contact-form-grid .pixel-input {
    width: 100%;
}

.contact-form-grid .btn-pixel {
    width: auto;
    min-width: 220px;
}

.contact-form-grid > div {
    min-width: 0;
}

.contact-form-grid .label-mini {
    margin-bottom: 8px;
}

.contact-form-grid .pixel-input,
.contact-form-grid textarea.pixel-input {
    background: linear-gradient(180deg, rgba(8,12,24,0.96), rgba(14,20,38,0.96));
    border: 2px solid rgba(255,255,255,0.12);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.04),
        0 8px 22px rgba(0,0,0,0.28);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.contact-form-grid .pixel-input:hover,
.contact-form-grid textarea.pixel-input:hover {
    border-color: rgba(0,243,255,0.35);
}

.contact-form-grid .pixel-input:focus,
.contact-form-grid textarea.pixel-input:focus {
    border-color: var(--primary-cyan);
    box-shadow:
        0 0 0 3px rgba(0,243,255,0.10),
        0 0 18px rgba(0,243,255,0.18),
        inset 0 1px 0 rgba(255,255,255,0.05);
    transform: translateY(-1px);
}

.contact-form-grid textarea.pixel-input::placeholder,
.contact-form-grid .pixel-input::placeholder {
    color: rgba(203,213,225,0.72);
}

.cookie-consent-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 400;
    display: block;
    background: rgba(5, 8, 17, 0.96);
    border: 2px solid rgba(255,255,255,0.10);
    border-radius: 16px;
    box-shadow: 0 18px 60px rgba(0,0,0,0.45);
    backdrop-filter: blur(10px);
    contain: layout paint;
}

.cookie-consent-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
}

.cookie-consent-text {
    flex: 1;
    min-width: 0;
    color: var(--text-gray);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.65;
}

.cookie-consent-text strong {
    display: block;
    color: var(--primary-cyan);
    margin-bottom: 6px;
    font-size: 15px;
}

.cookie-consent-text a {
    color: #fff08a;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cookie-consent-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

.cookie-consent-actions .btn-pixel {
    width: auto;
    min-width: 170px;
    min-height: 48px;
}

footer {
    background: #050811;
    border-top: 2px solid rgba(255,255,255,0.05);
    padding: 40px 0 20px;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-grid h2 {
    font-size: 16px;
    color: var(--primary-cyan);
    margin-bottom: 15px;
}

.footer-grid ul {
    list-style: none;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.8;
}

.footer-grid a {
    color: #e2e8f0;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 6px 0;
}

.footer-grid a:hover {
    color: #ff6ab7;
}

.footer-bottom {
    text-align: center;
    font-size: 12px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 800;
    color: #94a3b8;
    border-top: 1px solid #243047;
    padding-top: 20px;
    line-height: 1.5;
}

@media (max-width: 920px) {
    .logo-text strong { font-size: 20px; }
    .nav-btn { font-size: 11px; padding: 9px 10px; }
    .btn-pixel { font-size: 12px; }
}

@media (max-width: 768px) {
    .container { padding: 0 14px; }

    header { padding: 12px 0; }

    .menu-toggle { display: block; }

    .logo-area {
        gap: 10px;
        max-width: calc(100% - 56px);
    }

    .logo-area > span { font-size: 32px; }

    .logo-text strong {
        font-size: 18px;
        line-height: 1.1;
    }

    .logo-text span {
        font-size: 10px;
        line-height: 1.35;
    }

    .nav-desktop {
        display: none;
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        width: 100%;
        background: var(--bg-dark);
        flex-direction: column;
        padding: 16px;
        border-bottom: 2px solid var(--primary-cyan);
        box-shadow: 0 10px 20px rgba(0,0,0,0.8);
        border-radius: 0 0 14px 14px;
    }
    
    
    
    
    .score-table {
    width: 100%;
    table-layout: fixed;
}

.score-table th {
    font-size: 10px;
    padding: 10px 4px;
}

.score-table td {
    font-size: 13px;
    padding: 10px 4px;
}

.score-table th:nth-child(1),
.score-table td:nth-child(1) {
    width: 36px;
}

.score-table th:nth-child(3),
.score-table td:nth-child(3),
.score-table th:nth-child(4),
.score-table td:nth-child(4),
.score-table th:nth-child(5),
.score-table td:nth-child(5) {
    width: 52px;
}

.score-table td:nth-child(2) a,
.score-table td:nth-child(2) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
    
    

    .nav-desktop.mobile-open { display: flex; }

    .nav-btn {
        width: 100%;
        text-align: center;
        font-size: 14px;
        padding: 14px 12px;
    }

    .auth-buttons {
        display: none;
        width: 100%;
        margin-left: 0;
    }

    .auth-buttons.mobile-show {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 10px;
        margin-top: 10px;
    }

    .btn-pixel { width: 100%; font-size: 13px; }

    main { padding: 28px 0 36px; }

    .page-box { padding: 18px; }

    main > .page-box:first-child { margin-top: 10px; }

    .section-title {
        font-size: 17px;
        line-height: 1.45;
    }

    .breadcrumb {
        font-size: 12px;
        padding: 10px 12px;
        margin-bottom: 18px;
    }

    .input-group { flex-direction: column; }

    .pixel-input,
    .pixel-select {
        font-size: 15px;
        min-height: 50px;
    }

    .modal-content {
        padding: 22px 18px;
    }

    .modal-title {
        font-size: 16px;
    }

    .label-mini {
        font-size: 11px;
    }

  

    .profile-info h1 {
        font-size: 21px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .stat-box {
        padding: 14px 12px;
    }

    .stat-box span {
        font-size: 11px;
    }

    .stat-box strong {
        font-size: 16px;
    }

    .dict-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .dict-word {
        font-size: 14px;
    }

    .dict-hint {
        width: 100%;
        font-size: 14px;
    }

    .level-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .level-grid .level-card:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .level-card h3 {
        font-size: 16px;
    }

    .level-card p,
    .level-card small {
        font-size: 13px;
    }

    .footer-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }

    .footer-grid h2 {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .footer-grid ul {
        font-size: 12px;
        line-height: 1.7;
    }

    .game-shell {
        gap: 10px;
    }

    .game-ad {
        min-height: 68px;
        padding: 8px 10px;
    }

    .game-brand-row {
        gap: 8px;
    }

    .game-brand-mark {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .game-brand-title {
        font-size: 12px;
    }

    .game-brand-subtitle {
        font-size: 11px;
    }

    .game-topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px;
        padding: 10px;
    }

    .game-topbar-main {
        min-width: 0;
        width: 100%;
    }

    .game-topbar-copy strong {
        font-size: 13px;
    }

    .game-topbar-copy span {
        font-size: 11px;
    }

    .game-actions {
        width: auto;
        justify-content: flex-end;
        flex-wrap: nowrap;
    }

    .game-badge {
        min-height: 32px;
        padding: 6px 10px;
        font-size: 9px;
    }

    .game-stats {
        gap: 6px;
    }

    .game-stat {
        padding: 10px 6px;
    }

    .game-stat span {
        font-size: 10px;
    }

    .game-stat strong {
        font-size: 14px;
        margin-top: 4px;
    }

    .game-question {
        min-height: 82px;
        padding: 12px;
    }

    .game-question-word {
        font-size: 16px;
        line-height: 1.32;
    }

    .game-feedback {
        min-height: 20px;
        font-size: 13px;
    }

    .game-options {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .option-btn {
        min-height: 52px;
        font-size: 15px;
        padding: 11px 12px;
        border-radius: 11px;
    }

    .game-bottom {
        gap: 6px;
    }

    .level-note {
        font-size: 12px;
    }

    .play-level-card {
        min-height: 100%;
    }

    .game-route-screen {
        padding:
            max(8px, env(safe-area-inset-top))
            max(8px, env(safe-area-inset-right))
            max(10px, env(safe-area-inset-bottom))
            max(8px, env(safe-area-inset-left));
    }

    .contact-form-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .contact-form-grid .btn-pixel {
        width: 100%;
        min-width: 0;
    }

    .contact-form-grid textarea.pixel-input {
        min-height: 190px;
    }

    .cookie-consent-bar {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }

    .cookie-consent-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px;
    }

    .cookie-consent-text {
        font-size: 13px;
        line-height: 1.6;
    }

    .cookie-consent-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-consent-actions .btn-pixel {
        width: 100%;
        min-width: 0;
    }
}

@media (max-height: 740px) {
    .game-fullscreen {
        align-items: flex-start;
    }

    .game-route-screen {
        min-height: auto;
    }

    .game-shell {
        justify-content: flex-start;
    }

    .game-options {
        max-height: none;
    }
}

@media (max-width: 520px) {
    .container { padding: 0 12px; }

    .logo-area { gap: 8px; }
    .logo-area > span { font-size: 28px; }

    .logo-text strong {
        font-size: 16px;
        line-height: 1.08;
    }

    .logo-text span {
        font-size: 9px;
    }

    .section-title {
        font-size: 15px;
        margin-bottom: 16px;
    }

    .page-box {
        padding: 16px 14px;
        border-radius: 14px;
    }

    .content-copy p {
        font-size: 15px;
        line-height: 1.72;
    }

    .profile-avatar-wrap { font-size: 64px; }

    .profile-info h1 {
        font-size: 19px;
    }

    .profile-sub {
        font-size: 13px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-header + .stats-grid .stat-box:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .word-detail-stats {
        grid-template-columns: 1fr;
    }

    .word-detail-stats .stat-box strong {
        font-size: 14px;
        line-height: 1.6;
        word-break: break-word;
    }

    .data-list li {
        font-size: 13px;
        gap: 10px;
    }

    .archive-card {
        flex-basis: 200px;
        padding: 16px;
    }

    .archive-card h3 {
        font-size: 16px;
    }

    .member-card {
        padding: 14px 12px;
    }

    .dict-word {
        font-size: 13px;
    }

    .tiny-badge {
        font-size: 9px;
        min-height: 28px;
    }

    .page-link {
        min-width: 40px;
        min-height: 40px;
        font-size: 13px;
    }

    .game-stat strong {
        font-size: 12px;
    }

    .game-ad {
        min-height: 62px;
        padding: 7px 9px;
    }

    .game-ad-slot {
        min-height: 50px;
    }

    .game-question {
        min-height: 70px;
        padding: 10px;
    }

    .game-question-word {
        font-size: clamp(14px, 5.6vw, 18px);
        line-height: 1.24;
    }

    .option-btn {
        font-size: 13px;
        padding: 10px;
        min-height: 46px;
    }

    .level-note {
        font-size: 11px;
    }

    .final-score {
        font-size: 32px;
    }

    .final-meta {
        font-size: 14px;
    }

    .cookie-consent-bar {
        left: 8px;
        right: 8px;
        bottom: 8px;
        border-radius: 14px;
    }

    .cookie-consent-text {
        font-size: 11px;
        line-height: 1.55;
    }

    .cookie-consent-text strong {
        font-size: 13px;
    }

    .contact-form-grid textarea.pixel-input {
        min-height: 170px;
        font-size: 14px;
    }
}

@media (max-width: 380px) {
    .logo-text strong {
        font-size: 14px;
    }

    .logo-text span {
        font-size: 8px;
    }

    .btn-pixel {
        font-size: 12px;
        min-height: 48px;
    }

    .section-title {
        font-size: 14px;
    }

    .stat-box strong {
        font-size: 15px;
    }

    .game-topbar-copy strong {
        font-size: 12px;
    }

    .game-topbar-copy span {
        font-size: 10px;
    }

    .game-badge {
        min-width: 54px;
        font-size: 8px;
    }
}