:root {
    --bg-main: #09120c;
    --bg-card: rgba(12, 20, 16, 0.88);
    --bg-overlay: radial-gradient(circle at center, rgba(16, 26, 20, 0.92) 0%, rgba(6, 12, 8, 0.98) 100%);
    --accent-emerald: #2bda97;
    --accent-gold: #f7ca53;
    --accent-green-dark: #278564;
    --border-emerald: rgba(43, 218, 151, 0.22);
    --border-gold: rgba(247, 202, 83, 0.5);
    --text-primary: #ffffff;
    --text-muted: #728b78;
    --text-label: #2bda97;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px 32px;
    min-height: 100vh;
}

.title {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #ffffff;
    margin: 4px 0 2px;
    text-align: center;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.title span {
    color: #278564;
}

.tagline {
    font-size: 12px;
    color: #687569;
    margin-bottom: 14px;
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.8px;
}

.game-wrap {
    width: 100%;
    max-width: 900px;
    aspect-ratio: 16 / 9;
    position: relative;
}

.canvas-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-emerald);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(43, 218, 151, 0.1);
    background: #09120c;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: none;
}

/* Floating HUD Top Bar */
.hud-top {
    position: absolute;
    top: 10px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    pointer-events: none;
}

.hud-pill {
    background: rgba(12, 20, 16, 0.88);
    border: 1px solid var(--border-emerald);
    color: var(--text-muted);
    font-family: 'Chakra Petch', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 5px 14px;
    border-radius: 6px;
    pointer-events: auto;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.hud-pill b {
    color: var(--accent-gold);
}

.hud-pill-group {
    display: flex;
    gap: 8px;
    align-items: center;
    background: rgba(12, 20, 16, 0.88);
    border: 1px solid var(--border-emerald);
    padding: 5px 12px;
    border-radius: 6px;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    pointer-events: auto;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.hud-pill-group b {
    color: var(--accent-emerald);
}

.hp-box {
    position: absolute;
    top: 48px;
    left: 12px;
    width: 140px;
    background: rgba(12, 20, 16, 0.88);
    border: 1px solid var(--border-emerald);
    border-radius: 6px;
    padding: 6px 10px;
    z-index: 10;
    backdrop-filter: blur(8px);
}

.hp-track {
    height: 8px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 3px;
    overflow: hidden;
}

.hp-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #e53935, #ff5252);
    transition: width .15s;
    border-radius: 3px;
}

.hp-text {
    color: #fff;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 11px;
    font-weight: 700;
    margin-top: 4px;
}

.boss-box {
    position: absolute;
    top: 48px;
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    display: none;
    z-index: 10;
}

.boss-inner {
    background: rgba(12, 20, 16, 0.88);
    border: 1px solid var(--border-emerald);
    border-radius: 6px;
    padding: 6px 10px;
    backdrop-filter: blur(8px);
}

.boss-name {
    color: var(--accent-emerald);
    font-family: 'Chakra Petch', sans-serif;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 3px;
    text-align: center;
    letter-spacing: 0.5px;
}

.boss-track {
    height: 8px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 3px;
    overflow: hidden;
}

.boss-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #d81b60, #ff4081);
}

.buff-row {
    position: absolute;
    top: 48px;
    right: 12px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.weapon-row {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
    pointer-events: auto;
}

.weapon-tag {
    position: absolute;
    bottom: 10px;
    left: 12px;
    background: rgba(12, 20, 16, 0.88);
    border: 1px solid var(--border-emerald);
    color: var(--accent-emerald);
    font-family: 'Chakra Petch', sans-serif;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 6px;
    z-index: 10;
    backdrop-filter: blur(8px);
    letter-spacing: 0.5px;
}

/* ── Overlays & Modals ─────────────────────────────── */
.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
    text-align: center;
    background: rgba(8, 14, 10, 0.9);
    backdrop-filter: blur(14px);
    cursor: default;
    z-index: 50;
}

.overlay h2 {
    margin: 0;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 0 0 12px rgba(43, 218, 151, 0.3);
}

.overlay p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
    max-width: 360px;
    line-height: 1.6;
}

.btn {
    background: linear-gradient(180deg, #f7ca53 0%, #e6a728 100%);
    color: #2b1f09;
    border: none;
    border-radius: 6px;
    padding: 10px 22px;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(230, 167, 40, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
    box-shadow: 0 6px 22px rgba(230, 167, 40, 0.5);
}

.btn:active {
    transform: translateY(1px);
}

.btn.outline {
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    border: 1px solid var(--border-emerald);
    box-shadow: none;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 13px;
    font-weight: 700;
}

.btn.outline:hover {
    background: rgba(43, 218, 151, 0.1);
    border-color: var(--accent-emerald);
    box-shadow: 0 0 14px rgba(43, 218, 151, 0.25);
}

.wbtn {
    background: rgba(18, 26, 22, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #b8ccbe;
    border-radius: 8px;
    padding: 6px 10px;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.18s ease;
}

.wbtn:hover {
    border-color: #d99f26;
    color: #ffffff;
    transform: translateY(-1px);
}

.wbtn.active {
    border-color: #278564;
    color: #ffffff;
    background: rgba(39, 133, 100, 0.35);
    box-shadow: 0 0 12px rgba(39, 133, 100, 0.4), inset 0 0 0 1px #278564;
}

.wbtn.locked {
    opacity: 0.65;
    border-color: rgba(255, 255, 255, 0.1);
}

.wbtn-key {
    opacity: 0.6;
    font-size: 9px;
}

.wbtn-cost {
    background: linear-gradient(180deg, #f7ca53 0%, #e6a728 100%);
    color: #2b1f09;
    font-weight: 800;
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 4px;
    margin-left: 2px;
    box-shadow: 0 2px 6px rgba(230, 167, 40, 0.3);
}

.wbtn-timer {
    background: #e53935;
    color: #ffffff;
    font-weight: 800;
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 4px;
    margin-left: 2px;
    box-shadow: 0 2px 6px rgba(229, 57, 53, 0.4);
}

.wbtn-free {
    background: #278564;
    color: #ffffff;
    font-weight: 800;
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 4px;
    margin-left: 2px;
}

/* ── Character Select Parchment Theme ───────── */
.char-select-modal-card {
    max-width: 520px;
    padding: 22px 24px;
    gap: 12px;
}

.char-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
    margin-top: 6px;
    margin-bottom: 6px;
}

.char-card {
    background: #ffffff;
    border: 2px solid #d4cbb8;
    border-radius: 16px;
    padding: 12px 10px;
    cursor: pointer;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.18s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.char-card:hover {
    border-color: #278564;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 133, 100, 0.2);
}

.char-card.selected {
    border-color: #278564;
    background: #f7f9f7;
    box-shadow: 0 6px 24px rgba(39, 133, 100, 0.25), inset 0 0 0 1px #278564;
}

.char-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.char-avatar-box {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #222923;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.char-card .char-name {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #222923;
    letter-spacing: 0.5px;
}

.char-card.selected .char-name {
    color: #278564;
}

.char-card .char-desc {
    font-size: 10px;
    color: #687569;
    line-height: 1.3;
    height: 28px;
}

.char-card .char-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #e1d9c8;
    border: 1px solid #c5bba7;
    padding: 6px 8px;
    border-radius: 9px;
}

.char-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 9px;
    font-weight: 700;
    color: #556156;
}

.char-stat-bar-track {
    flex: 1;
    height: 5px;
    background: #c5bba7;
    border-radius: 3px;
    overflow: hidden;
}

.char-stat-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width .25s ease;
}

/* ── 3-Column Dashboard Main Menu (Match Screenshot) ──── */
.menu-overlay {
    background: radial-gradient(circle at center, rgba(38, 26, 16, 0.45) 0%, rgba(16, 10, 6, 0.75) 100%);
    backdrop-filter: blur(4px);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 100;
}

.dashboard-wrap {
    display: grid;
    grid-template-columns: 210px 1fr 240px;
    gap: 16px;
    width: 100%;
    max-width: 860px;
    height: 100%;
    max-height: 480px;
    align-items: center;
}

/* 1. Left Sidebar */
.dash-sidebar {
    background: rgba(241, 237, 226, 0.92);
    border: 3px solid #d4cbb8;
    border-radius: 22px;
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    backdrop-filter: blur(12px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), inset 0 2px 0 #ffffff;
}

.side-logo-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.side-logo-title {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.05;
    color: #222923;
    margin: 0;
    letter-spacing: 0.5px;
}

.side-logo-title span {
    color: #278564;
}

.side-logo-sub {
    font-size: 11px;
    color: #687569;
    margin: 5px 0 0 0;
    line-height: 1.3;
    font-weight: 500;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: 1px solid transparent;
    color: #556156;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.8px;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.nav-item svg {
    color: #556156;
    transition: color 0.2s ease;
}

.nav-item:hover {
    background: #e1d9c8;
    color: #222923;
}

.nav-item:hover svg {
    color: #222923;
}

.nav-item.active {
    background: #278564;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(39, 133, 100, 0.35);
}

.nav-item.active svg {
    color: #ffffff;
}

/* 2. Center Parchment Pass Card */
.dash-center {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.parchment-card {
    background: #f1ede2;
    border: 3px solid #d4cbb8;
    border-radius: 22px;
    padding: 24px 28px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), inset 0 2px 0 #ffffff;
    color: #222923;
}

.parchment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.compass-icon {
    color: #278564;
    font-size: 10px;
}

.parchment-tag {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #278564;
}

.parchment-title {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 30px;
    font-weight: 700;
    color: #222923;
    margin: 0;
    line-height: 1.1;
    letter-spacing: 0.5px;
}

.parchment-title span {
    color: #278564;
}

.parchment-sub {
    font-size: 12px;
    color: #687569;
    margin: 3px 0 16px 0;
    font-weight: 500;
}

.diff-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin-bottom: 20px;
}

.diff-label {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #687569;
}

.diff-row {
    display: flex;
    background: #e1d9c8;
    border: 1px solid #c5bba7;
    border-radius: 12px;
    padding: 3px;
    gap: 3px;
    width: 100%;
}

.diff-btn {
    flex: 1;
    border: none;
    background: transparent;
    color: #556156;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 10px;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.diff-btn.active {
    background: #278564;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(39, 133, 100, 0.35);
}

.map-row {
    display: flex;
    background: #e1d9c8;
    border: 1px solid #c5bba7;
    border-radius: 12px;
    padding: 3px;
    gap: 3px;
    width: 100%;
}

.map-btn {
    flex: 1;
    border: none;
    background: transparent;
    color: #556156;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 10px;
    font-weight: 700;
    padding: 6px 4px;
    border-radius: 9px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.map-btn:hover {
    color: #222923;
}

.map-btn.active {
    background: #278564;
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(39, 133, 100, 0.35);
}

.arena-play-btn {
    width: 100%;
    border: 2px solid #d99f26;
    background: linear-gradient(180deg, #f7ca53 0%, #e6a728 100%);
    color: #2b1f09;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 13px 20px;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 20px rgba(230, 167, 40, 0.4), inset 0 1px 0 #ffea9f;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.arena-play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(230, 167, 40, 0.55), inset 0 1px 0 #fff3c4;
}

.arena-play-btn:active {
    transform: translateY(1px);
}

/* 3. Right Column Stats & Features */
.dash-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
}

.right-stats-card {
    background: rgba(241, 237, 226, 0.92);
    border: 3px solid #d4cbb8;
    border-radius: 18px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(12px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), inset 0 2px 0 #ffffff;
}

.stat-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-icon {
    font-size: 20px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-lbl {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: #687569;
}

.stat-val {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #222923;
}

.stat-divider {
    width: 1px;
    height: 28px;
    background: #c5bba7;
}

.about-arena-card {
    background: rgba(12, 20, 16, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    backdrop-filter: blur(12px);
}

.about-header {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #2bda97;
    margin-bottom: 2px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.feat-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feat-green { background: rgba(39, 133, 100, 0.25); color: #2bda97; }
.feat-blue { background: rgba(30, 120, 210, 0.25); color: #3ba2ff; }
.feat-purple { background: rgba(140, 60, 210, 0.25); color: #bf66ff; }

.feat-text {
    display: flex;
    flex-direction: column;
}

.feat-text b {
    font-size: 12px;
    color: #ffffff;
    font-weight: 600;
}

.feat-text span {
    font-size: 10px;
    color: #728b78;
    line-height: 1.3;
}

.pause-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-cyan);
    color: var(--accent-cyan);
    border-radius: 6px;
    padding: 4px 10px;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all .15s;
}

.pause-btn:hover {
    border-color: var(--accent-pink);
    color: var(--accent-pink);
    background: rgba(255, 0, 127, 0.12);
}

.settings-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 10px;
    font-size: 12px;
    color: #556156;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
}

.settings-group input[type="range"] {
    width: 120px;
    accent-color: #278564;
    cursor: pointer;
}

.settings-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #278564;
    cursor: pointer;
}

.info-content {
    width: 100%;
    text-align: left;
    font-size: 11px;
    color: #556156;
    line-height: 1.6;
    background: #e1d9c8;
    border: 1px solid #c5bba7;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 10px;
}

.info-content p {
    margin: 4px 0;
}

.info-content b {
    color: #278564;
}

/* ── Shop & Modal Overlay Parchment Theme ────────────── */
.shop-modal-card {
    max-width: 440px;
    padding: 20px 24px;
    gap: 12px;
}

.gold-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #e1d9c8;
    border: 1px solid #c5bba7;
    padding: 5px 14px;
    border-radius: 20px;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #556156;
    letter-spacing: 0.8px;
    margin-top: -4px;
    margin-bottom: 6px;
}

.gold-pill b {
    color: #278564;
}

.shop-item-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    margin-bottom: 12px;
}

.shop-item-card {
    background: #ffffff;
    border: 2px solid #d4cbb8;
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.shop-item-card:hover:not(.disabled) {
    border-color: #278564;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(39, 133, 100, 0.2);
}

.shop-item-card.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: #e9e4d7;
}

.shop-item-icon {
    font-size: 20px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f1ede2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.shop-item-details {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.shop-item-name {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #222923;
    line-height: 1.2;
}

.shop-item-desc {
    font-size: 10px;
    color: #687569;
    line-height: 1.2;
}

.shop-item-price {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: #278564;
    background: rgba(39, 133, 100, 0.12);
    padding: 4px 7px;
    border-radius: 6px;
    white-space: nowrap;
}

.shop-item-price.cant-afford {
    color: #c53030;
    background: rgba(197, 48, 48, 0.1);
}

.shop-item-price.is-maxed {
    color: #9c6814;
    background: rgba(217, 159, 38, 0.18);
    border: 1px solid rgba(217, 159, 38, 0.35);
}

.shop-item-lvl {
    font-size: 9px;
    font-weight: 700;
    color: #278564;
    background: #e4f3ed;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 6px;
    letter-spacing: 0.3px;
    display: inline-block;
    vertical-align: middle;
}

.shop-item-lvl.is-maxed {
    color: #9c6814;
    background: #faeed4;
}

.modal-card-sm {
    max-width: 360px;
    padding: 22px 24px;
}

.modal-btn-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
}

.modal-sec-btn {
    width: 100%;
    background: #e1d9c8;
    border: 1px solid #c5bba7;
    color: #222923;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.8px;
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-top: 4px;
}

.modal-sec-btn:hover {
    background: #278564;
    color: #ffffff;
    border-color: #278564;
    box-shadow: 0 4px 12px rgba(39, 133, 100, 0.3);
}

.footer {
    margin-top: 14px;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    text-align: center;
    opacity: 0.7;
}

/* ── Mobile Phone & Tablet Responsive Optimization ─────────────────── */

/* 1. Mobile Portrait & Small Screens (width <= 800px) */
@media (max-width: 800px) {
    body {
        padding: 0 !important;
        justify-content: center;
        min-height: 100vh;
        overflow-x: hidden;
    }
    .title, .tagline, .footer {
        display: none !important;
    }
    .game-wrap {
        width: 100vw !important;
        height: 100vh !important;
        max-width: none !important;
        max-height: none !important;
        aspect-ratio: auto !important;
    }
    .canvas-frame {
        border-radius: 0 !important;
        border: none !important;
    }

    .menu-overlay {
        padding: 10px !important;
        overflow-y: auto !important;
    }

    .dashboard-wrap {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        max-height: none !important;
        width: 100% !important;
        max-width: 420px !important;
        gap: 10px !important;
        padding-top: 10px !important;
        padding-bottom: 20px !important;
    }

    /* Reorder panels in portrait: Stats top, Center card middle, Sidebar bottom */
    .dash-right { order: 1; height: auto !important; }
    .dash-center { order: 2; height: auto !important; }
    .dash-sidebar { order: 3; height: auto !important; }

    .dash-sidebar {
        padding: 14px 16px !important;
        border-radius: 16px !important;
    }
    .side-nav {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        margin-top: 10px !important;
    }
    .nav-item {
        flex: 1 1 40% !important;
        padding: 8px 10px !important;
        font-size: 11px !important;
    }

    .parchment-card {
        padding: 16px 18px !important;
        border-radius: 18px !important;
        border-width: 2px !important;
    }
    .parchment-title {
        font-size: 24px !important;
    }

    .shop-item-grid {
        grid-template-columns: 1fr !important;
    }
    .char-grid {
        grid-template-columns: 1fr !important;
    }
}

/* 2. Mobile Landscape & Short Screens (height <= 600px) */
@media (max-height: 600px) and (orientation: landscape) {
    body {
        padding: 0 !important;
        justify-content: center;
        min-height: 100vh;
        overflow: hidden;
    }
    .title, .tagline, .footer {
        display: none !important;
    }
    .game-wrap {
        width: 100vw !important;
        height: 100vh !important;
        max-width: none !important;
        max-height: none !important;
        aspect-ratio: auto !important;
    }
    .canvas-frame {
        border-radius: 0 !important;
        border: none !important;
    }

    .menu-overlay {
        padding: 6px 12px !important;
        overflow-y: auto !important;
        align-items: center !important;
    }

    .dashboard-wrap {
        grid-template-columns: 170px 1fr 190px !important;
        gap: 10px !important;
        max-height: 94vh !important;
        max-width: 820px !important;
    }

    .dash-sidebar {
        padding: 12px 12px !important;
        border-radius: 16px !important;
    }
    .side-logo-title {
        font-size: 18px !important;
    }
    .side-logo-sub {
        font-size: 9px !important;
        margin-top: 2px !important;
    }
    .side-nav {
        margin-top: 10px !important;
        gap: 5px !important;
    }
    .nav-item {
        padding: 6px 10px !important;
        font-size: 10px !important;
        border-radius: 8px !important;
    }

    .parchment-card {
        padding: 12px 16px !important;
        border-radius: 16px !important;
        border-width: 2px !important;
        max-height: 94vh !important;
        overflow-y: auto !important;
    }
    .parchment-title {
        font-size: 22px !important;
    }
    .parchment-sub {
        font-size: 10px !important;
        margin: 2px 0 8px 0 !important;
    }
    .diff-section {
        margin-bottom: 6px !important;
        gap: 3px !important;
    }
    .diff-btn, .map-btn {
        padding: 4px 6px !important;
        font-size: 9px !important;
    }
    .arena-play-btn {
        padding: 8px 14px !important;
        font-size: 14px !important;
        border-radius: 10px !important;
    }

    .right-stats-card {
        padding: 10px 12px !important;
        border-radius: 14px !important;
    }
    .stat-val {
        font-size: 14px !important;
    }
    .stat-lbl {
        font-size: 8px !important;
    }

    /* Modal Cards in Landscape */
    .modal-card-sm, .shop-modal-card, .char-select-modal-card {
        max-height: 94vh !important;
        padding: 12px 18px !important;
        overflow-y: auto !important;
    }
    .shop-item-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
        margin-bottom: 8px !important;
    }
    .shop-item-card {
        padding: 6px 8px !important;
    }
    .char-grid {
        gap: 6px !important;
    }
    .char-card {
        padding: 8px 8px !important;
    }
    .char-card .char-desc {
        height: auto !important;
        font-size: 9px !important;
    }
}

:fullscreen body, :-webkit-full-screen body {
    padding: 0 !important;
    justify-content: center;
    overflow: hidden;
}
:fullscreen .title, :fullscreen .tagline, :fullscreen .footer,
:-webkit-full-screen .title, :-webkit-full-screen .tagline, :-webkit-full-screen .footer {
    display: none !important;
}
:fullscreen .game-wrap, :-webkit-full-screen .game-wrap {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: auto !important;
}
:fullscreen .canvas-frame, :-webkit-full-screen .canvas-frame {
    border-radius: 0 !important;
    border: none !important;
}

/* ── Web Banner Ads (Wide Viewports Only) ──────────── */
.web-ad-banner {
    display: none;
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    width: 160px;
    height: 600px;
}

@media (min-width: 1260px) {
    .web-ad-banner.active {
        display: block;
    }
    .web-ad-left {
        left: 20px;
    }
    .web-ad-right {
        right: 20px;
    }
}

/* ── Rotate Device Overlay (Mobile Portrait) ──────────── */
.rotate-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(9, 11, 14, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    box-sizing: border-box;
}

.rotate-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    background: rgba(22, 27, 34, 0.92);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 32px 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
    max-width: 300px;
}

.rotate-phone-anim {
    animation: rotateDevicePulse 2.4s ease-in-out infinite;
}

@keyframes rotateDevicePulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.06) rotate(-8deg); }
}

.rotate-title {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 1px;
}

.rotate-text {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #a3b3c2;
    line-height: 1.5;
}