/* ============================================================
   GOTHIC IDLE — Main Stylesheet
   Dark medieval aesthetic, mobile-first
   ============================================================ */

:root {
  --bg-darkest: #0a0806;
  --bg-dark: #110e0a;
  --bg-mid: #1a1410;
  --bg-card: #201a14;
  --bg-card2: #2a221a;
  --bg-hover: #342a20;
  --border: #3d2f20;
  --border-bright: #5a4030;
  --gold: #c8960a;
  --gold-light: #e8b520;
  --gold-dim: #7a5a08;
  --red: #8b1a1a;
  --red-bright: #c02020;
  --green: #2a5c2a;
  --green-bright: #4a9c4a;
  --text-primary: #d4c09a;
  --text-secondary: #8a7060;
  --text-muted: #5a4838;
  --text-gold: #e8c060;
  --text-white: #f0e8d8;
  --tier1: #8a7060;
  --tier2: #6080a0;
  --tier3: #806040;
  --tier4: #c8960a;
  --shadow: 0 4px 24px rgba(0,0,0,0.8);
  --shadow-gold: 0 0 20px rgba(200,150,10,0.3);
  --radius: 6px;
  --radius-lg: 10px;
  --font-title: 'Cinzel', serif;
  --font-body: 'Crimson Text', serif;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg-darkest);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Screens ───────────────────────────────────────────── */
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; flex-direction: column; }

/* ── Auth Screen ───────────────────────────────────────── */
#auth-screen {
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--bg-darkest);
}

.auth-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(200,150,10,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 100%, rgba(139,26,26,0.1) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h60v60H0z' fill='none'/%3E%3Cpath d='M30 5L5 30l25 25 25-25z' fill='none' stroke='%23201a14' stroke-width='0.5'/%3E%3C/svg%3E");
  pointer-events: none;
}

.auth-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: min(420px, calc(100vw - 2rem));
  box-shadow: var(--shadow), var(--shadow-gold);
  position: relative;
  z-index: 1;
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-rune {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 12px rgba(200,150,10,0.6));
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(200,150,10,0.6)); }
  50% { filter: drop-shadow(0 0 20px rgba(232,181,32,0.8)); }
}

.logo-title {
  font-family: var(--font-title);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--text-gold);
  letter-spacing: 0.08em;
  text-shadow: 0 0 20px rgba(200,150,10,0.5);
}

.logo-sub {
  color: var(--text-secondary);
  font-style: italic;
  font-size: 0.95rem;
  margin-top: 0.3rem;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.auth-tab {
  flex: 1;
  padding: 0.6rem;
  background: var(--bg-mid);
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-title);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.05em;
}

.auth-tab.active {
  background: var(--gold-dim);
  color: var(--text-gold);
}

.auth-form { display: none; flex-direction: column; gap: 1rem; }
.auth-form.active { display: flex; }

.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group label {
  font-family: var(--font-title);
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-group input {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-group input:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 2px rgba(200,150,10,0.15);
}

.form-errors {
  color: #e05050;
  font-size: 0.88rem;
  min-height: 1.2em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  color: var(--bg-darkest);
  border: none;
  border-radius: var(--radius);
  padding: 0.8rem 1.5rem;
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}

.btn-primary:hover { filter: brightness(1.15); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Game Screen Layout ────────────────────────────────── */
#game-screen {
  display: none;
  flex-direction: column;
  min-height: 100vh;
}
#game-screen.active { display: flex; }

/* ── Top Bar ────────────────────────────────────────────── */
.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

.topbar-logo {
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--text-gold);
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.topbar-center {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
}

.topbar-stat {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-title);
  font-size: 0.85rem;
  color: var(--text-primary);
  background: var(--bg-mid);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  transition: color 0.3s;
}

.topbar-stat .stat-icon { font-size: 0.9rem; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.topbar-name {
  font-family: var(--font-title);
  font-size: 0.85rem;
  color: var(--text-gold);
  display: none;
}

@media (min-width: 600px) { .topbar-name { display: inline; } }

.btn-icon {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1rem;
  transition: all 0.2s;
}
.btn-icon:hover { border-color: var(--border-bright); color: var(--text-primary); }

/* ── Mobile Nav ─────────────────────────────────────────── */
.mobile-nav {
  display: flex;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  position: sticky;
  top: 49px;
  z-index: 99;
}
.mobile-nav::-webkit-scrollbar { display: none; }

.nav-btn {
  flex: 1 0 auto;
  min-width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.5rem 0.75rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-title);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.nav-btn:first-child { font-size: 1.2rem; }
.nav-btn span { font-size: 0.65rem; }

.nav-btn.active {
  color: var(--text-gold);
  border-bottom-color: var(--gold);
}

/* ── Game Layout ─────────────────────────────────────────── */
.game-layout {
  display: grid;
  grid-template-columns: 1fr;
  flex: 1;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .game-layout {
    grid-template-columns: 280px 1fr;
  }
}

/* ── Left Sidebar (notifications) ──────────────────────── */
.sidebar-left {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: none;
  flex-direction: column;
  height: calc(100vh - 100px);
  position: sticky;
  top: 100px;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .sidebar-left { display: flex; }
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-header h3 {
  font-family: var(--font-title);
  font-size: 0.85rem;
  color: var(--text-gold);
  letter-spacing: 0.06em;
  flex: 1;
}

.panel-icon { font-size: 1rem; }

.live-dot {
  width: 8px; height: 8px;
  background: var(--green-bright);
  border-radius: 50%;
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.notifications-feed {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.4rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.notif-item {
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
  line-height: 1.4;
  animation: slide-in 0.3s ease-out;
  border-left: 3px solid var(--border-bright);
}

.notif-item.type-level_up { border-left-color: var(--gold); }
.notif-item.type-item_drop { border-left-color: #4a80c0; }
.notif-item.type-quest_complete { border-left-color: var(--green-bright); }
.notif-item.type-shop { border-left-color: var(--red-bright); }

@keyframes slide-in {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.notif-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.2rem;
}

.notif-empty {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 2rem 1rem;
}

/* ── Main Content ────────────────────────────────────────── */
.main-content {
  padding: 1rem;
  overflow-y: auto;
  height: calc(100vh - 100px);
}

/* ── Panels ──────────────────────────────────────────────── */
.panel { display: none; }
.panel.active { display: block; }

.panel-title {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-gold);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
  letter-spacing: 0.06em;
}

/* ── Activity Card ───────────────────────────────────────── */
.activity-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
  transition: border-color 0.3s;
  flex-wrap: wrap;
}

.activity-card.active {
  border-color: var(--gold-dim);
  box-shadow: 0 0 12px rgba(200,150,10,0.15);
}

.activity-icon { font-size: 2rem; flex-shrink: 0; }

.activity-info { flex: 1; min-width: 0; }

.activity-name {
  font-family: var(--font-title);
  font-size: 0.95rem;
  color: var(--text-white);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.activity-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.activity-timer {
  font-family: var(--font-title);
  font-size: 0.9rem;
  color: var(--text-gold);
  flex-shrink: 0;
  text-align: right;
}

.btn-stop {
  background: var(--red);
  border: 1px solid var(--red-bright);
  color: #ffaaaa;
  border-radius: var(--radius);
  padding: 0.4rem 0.9rem;
  font-family: var(--font-title);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.btn-stop:hover { background: var(--red-bright); }

/* ── EXP Bar ─────────────────────────────────────────────── */
.exp-section {
  margin-bottom: 1.2rem;
}

.exp-header, .exp-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.exp-bar {
  height: 14px;
  background: var(--bg-dark);
  border-radius: 7px;
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.exp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-light));
  border-radius: 7px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.exp-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
  animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.exp-bonus {
  color: var(--green-bright);
  font-style: italic;
}

#time-to-level { color: var(--text-muted); font-size: 0.82rem; }

/* ── Stats Grid ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

@media (min-width: 480px) {
  .stats-grid { grid-template-columns: repeat(6, 1fr); }
}

.stat-card {
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.5rem;
  text-align: center;
  transition: border-color 0.2s;
}

.stat-card:hover { border-color: var(--border-bright); }

.stat-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.stat-value {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--text-gold);
  font-weight: 700;
}

/* ── Equipment ───────────────────────────────────────────── */
.section-title {
  font-family: var(--font-title);
  font-size: 0.9rem;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.equipment-section { margin-bottom: 1.5rem; }

.equipment-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

@media (min-width: 480px) {
  .equipment-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
  .equipment-grid { grid-template-columns: repeat(4, 1fr); }
}

.equip-slot {
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem;
  text-align: center;
  transition: all 0.2s;
  position: relative;
}

.equip-slot.has-item {
  border-color: var(--gold-dim);
  background: var(--bg-card2);
}

.equip-icon { font-size: 1.3rem; margin-bottom: 0.2rem; }

.equip-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  font-family: var(--font-title);
  letter-spacing: 0.05em;
}

.equip-value {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.equip-slot.has-item .equip-value { color: var(--text-primary); }

.set-bonus-display {
  margin-top: 0.75rem;
  background: linear-gradient(135deg, rgba(200,150,10,0.1), rgba(200,150,10,0.05));
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  font-size: 0.88rem;
  color: var(--text-gold);
  text-align: center;
}

/* ── Activities Panel ────────────────────────────────────── */
.activities-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.act-tab {
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.9rem;
  color: var(--text-secondary);
  font-family: var(--font-title);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s;
}

.act-tab.active {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--text-gold);
}

.expedition-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

@media (min-width: 640px) {
  .expedition-list { grid-template-columns: repeat(2, 1fr); }
}

.expedition-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.expedition-card.locked {
  opacity: 0.5;
  pointer-events: none;
}

.expedition-card.current {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(200,150,10,0.2);
}

.expedition-card:not(.locked):hover {
  border-color: var(--border-bright);
  background: var(--bg-hover);
}

.exp-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.exp-card-title {
  font-family: var(--font-title);
  font-size: 0.88rem;
  color: var(--text-white);
  font-weight: 600;
  line-height: 1.3;
}

.exp-card-emoji { font-size: 1.4rem; flex-shrink: 0; }

.exp-card-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
  font-style: italic;
}

.exp-card-stats {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}

.exp-stat-badge {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.exp-stat-badge.gold { border-color: var(--gold-dim); color: var(--text-gold); }

.tier-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-family: var(--font-title);
  letter-spacing: 0.05em;
}

.tier-1 { background: rgba(138,112,96,0.3); color: var(--tier1); }
.tier-2 { background: rgba(96,128,160,0.3); color: var(--tier2); }
.tier-3 { background: rgba(128,96,64,0.3); color: var(--tier3); }
.tier-4 { background: rgba(200,150,10,0.3); color: var(--tier4); }

.btn-expedition {
  width: 100%;
  background: var(--bg-mid);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 0.5rem;
  color: var(--text-primary);
  font-family: var(--font-title);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}

.btn-expedition:hover {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--text-gold);
}

.btn-expedition.active-btn {
  background: rgba(200,150,10,0.2);
  border-color: var(--gold);
  color: var(--gold-light);
}

.btn-expedition:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.lock-badge {
  display: inline-block;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  width: 100%;
  text-align: center;
}

/* ── Quests Panel ────────────────────────────────────────── */
.quest-list { display: flex; flex-direction: column; gap: 0.8rem; }

.quest-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  transition: all 0.2s;
}

.quest-card.completed { border-color: var(--green); }
.quest-card.locked { opacity: 0.55; }
.quest-card.active-quest { border-color: var(--gold-dim); }

.quest-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.quest-npc-icon { font-size: 1.8rem; flex-shrink: 0; }

.quest-info { flex: 1; }

.quest-name {
  font-family: var(--font-title);
  font-size: 0.95rem;
  color: var(--text-white);
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.quest-npc-name {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-style: italic;
}

.quest-status-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-family: var(--font-title);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.quest-status-badge.done { background: rgba(74,156,74,0.2); color: var(--green-bright); border: 1px solid var(--green); }
.quest-status-badge.todo { background: rgba(90,72,56,0.3); color: var(--text-secondary); border: 1px solid var(--border); }
.quest-status-badge.inprogress { background: rgba(200,150,10,0.2); color: var(--text-gold); border: 1px solid var(--gold-dim); }

.quest-dialog {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 0.8rem;
  line-height: 1.5;
  border-left: 2px solid var(--border-bright);
  padding-left: 0.8rem;
}

.quest-meta {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.quest-badge {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.quest-reward-text {
  font-size: 0.82rem;
  color: var(--green-bright);
  margin-bottom: 0.7rem;
}

.btn-quest {
  background: var(--bg-mid);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-title);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}

.btn-quest:hover {
  background: rgba(74,156,74,0.2);
  border-color: var(--green-bright);
  color: var(--green-bright);
}

.quest-timer-progress {
  height: 4px;
  background: var(--bg-dark);
  border-radius: 2px;
  margin-top: 0.6rem;
  overflow: hidden;
}

.quest-timer-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  transition: width 1s linear;
}

.chapter-bonus-card {
  background: linear-gradient(135deg, rgba(200,150,10,0.1), rgba(200,150,10,0.05));
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-lg);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  text-align: center;
}

/* ── Shop Panel ──────────────────────────────────────────── */
.shop-currencies {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-family: var(--font-title);
  font-size: 0.88rem;
  color: var(--text-gold);
}

.shop-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}

@media (min-width: 640px) {
  .shop-list { grid-template-columns: repeat(2, 1fr); }
}

.shop-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  transition: all 0.2s;
}

.shop-card.owned { border-color: var(--green); }
.shop-card.cant-afford { opacity: 0.65; }

.shop-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.shop-card-icon { font-size: 2rem; }

.shop-card-info { flex: 1; }

.shop-card-name {
  font-family: var(--font-title);
  font-size: 0.9rem;
  color: var(--text-white);
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.shop-card-desc {
  font-size: 0.82rem;
  color: var(--green-bright);
}

.shop-card-cost {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  font-size: 0.83rem;
  color: var(--text-secondary);
}

.cost-item { display: flex; align-items: center; gap: 0.25rem; }

.btn-buy {
  width: 100%;
  background: var(--bg-mid);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 0.5rem;
  color: var(--text-gold);
  font-family: var(--font-title);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}

.btn-buy:hover:not(:disabled) {
  background: var(--gold-dim);
  color: var(--bg-darkest);
}

.btn-buy.owned-btn {
  background: rgba(74,156,74,0.15);
  border-color: var(--green);
  color: var(--green-bright);
  cursor: default;
}

.btn-buy:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Ranking Panel ────────────────────────────────────────── */
.my-rank-card {
  background: linear-gradient(135deg, rgba(200,150,10,0.1), rgba(200,150,10,0.05));
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-family: var(--font-title);
  font-size: 0.88rem;
  color: var(--text-gold);
  min-height: 2.5rem;
}

.ranking-list { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }

.rank-row {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: border-color 0.2s;
}

.rank-row:hover { border-color: var(--border-bright); }
.rank-row.rank-me { border-color: var(--gold-dim); }

.rank-pos {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 700;
  min-width: 2rem;
  text-align: center;
}

.rank-pos.top1 { color: #ffd700; }
.rank-pos.top2 { color: #c0c0c0; }
.rank-pos.top3 { color: #cd7f32; }
.rank-pos.other { color: var(--text-muted); }

.rank-info { flex: 1; min-width: 0; }

.rank-name {
  font-family: var(--font-title);
  font-size: 0.9rem;
  color: var(--text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-details {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.1rem;
}

.rank-level {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--text-gold);
  font-weight: 700;
  flex-shrink: 0;
}

.rank-status {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.ranking-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding-top: 0.5rem;
}

.btn-secondary {
  background: var(--bg-mid);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 0.45rem 0.9rem;
  color: var(--text-secondary);
  font-family: var(--font-title);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover:not(:disabled) { border-color: var(--gold-dim); color: var(--text-gold); }
.btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }

#rank-page-info {
  font-family: var(--font-title);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ── Toasts ──────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 5rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  pointer-events: none;
}

@media (min-width: 768px) {
  #toast-container { bottom: 1.5rem; }
}

.toast {
  background: var(--bg-card2);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  max-width: min(320px, calc(100vw - 2rem));
  font-size: 0.88rem;
  color: var(--text-primary);
  animation: toast-in 0.3s ease-out, toast-out 0.3s ease-in 3.7s forwards;
  box-shadow: var(--shadow);
  pointer-events: auto;
  line-height: 1.4;
}

.toast.success { border-left: 3px solid var(--green-bright); }
.toast.error { border-left: 3px solid var(--red-bright); }
.toast.info { border-left: 3px solid #4a80c0; }
.toast.gold { border-left: 3px solid var(--gold); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}

/* ── Level Up Overlay ────────────────────────────────────── */
.levelup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.levelup-content {
  text-align: center;
  animation: levelup-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.levelup-anim {
  font-size: 5rem;
  animation: spin-once 0.8s ease-out;
  filter: drop-shadow(0 0 30px rgba(200,150,10,0.9));
}

.levelup-text {
  font-family: var(--font-title);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--text-gold);
  letter-spacing: 0.15em;
  text-shadow: 0 0 30px rgba(200,150,10,0.8);
  margin-top: 0.5rem;
}

.levelup-level {
  font-family: var(--font-title);
  font-size: 4rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 20px rgba(255,255,255,0.5);
}

@keyframes levelup-pop {
  from { transform: scale(0) rotate(-10deg); opacity: 0; }
  to { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes spin-once {
  from { transform: rotate(-180deg) scale(0.5); }
  to { transform: rotate(0deg) scale(1); }
}

/* ── Utility ─────────────────────────────────────────────── */
.text-gold { color: var(--text-gold); }
.text-muted { color: var(--text-muted); }
.text-green { color: var(--green-bright); }
.text-red { color: var(--red-bright); }
.hidden { display: none !important; }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-bright); }

/* ── Skeleton loader ─────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-mid) 25%, var(--bg-card2) 50%, var(--bg-mid) 75%);
  background-size: 200% 100%;
  animation: skeleton-wave 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes skeleton-wave {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ── Number pop animation ────────────────────────────────── */
.num-pop {
  animation: num-pop 0.4s ease-out;
}

@keyframes num-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); color: var(--gold-light); }
  100% { transform: scale(1); }
}

/* ── Notification mobile panel ───────────────────────────── */
.notif-mobile-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  cursor: pointer;
  font-family: var(--font-title);
  font-size: 0.82rem;
  color: var(--text-secondary);
  width: 100%;
  transition: all 0.2s;
}
.notif-mobile-toggle:hover { border-color: var(--border-bright); }

@media (min-width: 1024px) {
  .notif-mobile-toggle { display: none; }
}

/* ── Fish/cemetery warning ────────────────────────────────── */
.fish-required {
  background: rgba(139,26,26,0.15);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  padding: 0.4rem 0.7rem;
  font-size: 0.78rem;
  color: #e08080;
  margin-top: 0.4rem;
}

/* ── Responsive tweaks ────────────────────────────────────── */
@media (max-width: 480px) {
  .topbar-center { gap: 0.4rem; }
  .topbar-stat { font-size: 0.78rem; padding: 0.2rem 0.45rem; }
  .panel-title { font-size: 1.05rem; }
  .main-content { padding: 0.75rem; }
}
