/* 🇰🇷 งานเกาหลี — DRAMATIC REDESIGN */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700;900&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Noto Sans KR', system-ui, sans-serif;
  background: #0a0e1a;
  color: #f1f5f9;
  max-width: 480px; margin: 0 auto; padding: 0 0 90px;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ─── Animated Background ─── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(34,211,238,.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(167,139,250,.1) 0%, transparent 50%),
    radial-gradient(ellipse at 40% 100%, rgba(251,191,36,.06) 0%, transparent 50%);
  animation: bgShift 8s ease-in-out infinite alternate;
}
@keyframes bgShift {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.05) rotate(2deg); }
  100% { transform: scale(1) rotate(-2deg); }
}

/* ─── Header ─── */
.header {
  text-align: center; padding: 28px 16px 12px;
  position: relative;
}
.header h1 {
  font-size: 24px; font-weight: 900;
  background: linear-gradient(135deg, #22d3ee, #a78bfa, #f472b6);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; background-size: 200% auto;
  animation: gradShift 4s ease infinite;
}
@keyframes gradShift { 0%,100% { background-position: 0% center; } 50% { background-position: 100% center; } }
.header .sub {
  font-size: 11px; color: #64748b; margin-top: 3px; font-weight: 500;
}
.header .coin-display {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, rgba(251,191,36,.12), rgba(251,191,36,.05));
  border: 1px solid rgba(251,191,36,.3);
  border-radius: 24px; padding: 6px 18px; margin-top: 10px;
  font-size: 15px; font-weight: 700; color: #fbbf24;
  backdrop-filter: blur(8px);
  animation: coinGlow 2s ease-in-out infinite alternate;
}
@keyframes coinGlow { from { box-shadow: 0 0 8px rgba(251,191,36,.1); } to { box-shadow: 0 0 20px rgba(251,191,36,.25); } }

/* ─── Bottom Tab Bar ─── */
.tabs {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 100;
  display: flex; gap: 2px;
  background: rgba(15,23,42,.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(148,163,184,.1);
  padding: 6px 8px 12px;
  box-shadow: 0 -4px 24px rgba(0,0,0,.4);
}
.tab-btn {
  flex: 1; text-align: center; padding: 6px 2px;
  border: none; background: transparent; color: #64748b;
  font-size: 9px; font-weight: 500; border-radius: 10px; cursor: pointer;
  transition: all .25s; font-family: inherit;
  position: relative;
}
.tab-btn .tab-icon { font-size: 20px; display: block; margin-bottom: 3px; transition: transform .2s; }
.tab-btn.active {
  color: #22d3ee;
}
.tab-btn.active .tab-icon { transform: scale(1.15) translateY(-2px); }
.tab-btn.active::after {
  content: ''; position: absolute; top: -1px; left: 30%; right: 30%; height: 2px;
  background: #22d3ee; border-radius: 1px;
}
.tab-btn:not(.active):hover { color: #94a3b8; }

/* ─── Panels ─── */
.panel { display: none; padding: 0 16px; }
.panel.active { display: block; animation: panelSlide .35s cubic-bezier(.22,1,.36,1); }
@keyframes panelSlide {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Cards ─── */
.card {
  background: rgba(30,41,59,.6);
  border: 1px solid rgba(148,163,184,.1);
  border-radius: 16px; padding: 16px; margin-bottom: 12px;
  backdrop-filter: blur(8px);
  position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 3px; height: 100%;
  background: linear-gradient(180deg, #22d3ee, #a78bfa);
  border-radius: 0 2px 2px 0;
}
.card-title {
  font-size: 11px; font-weight: 600; color: #64748b;
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px;
}

/* ─── Stats ─── */
.stat-row { display: flex; gap: 10px; margin-bottom: 12px; }
.stat-box {
  flex: 1; text-align: center;
  background: rgba(30,41,59,.5);
  border: 1px solid rgba(148,163,184,.08);
  border-radius: 14px; padding: 16px 8px;
  transition: transform .2s;
}
.stat-box:first-child { border-color: rgba(34,211,238,.2); }
.stat-box:nth-child(2) { border-color: rgba(167,139,250,.2); }
.stat-box:nth-child(3) { border-color: rgba(251,191,36,.2); }
.stat-box .num { font-size: 26px; font-weight: 800; display: block; }
.stat-box:first-child .num { color: #22d3ee; }
.stat-box:nth-child(2) .num { color: #a78bfa; }
.stat-box:nth-child(3) .num { color: #fbbf24; }
.stat-box .label { font-size: 10px; color: #64748b; margin-top: 3px; font-weight: 500; }

/* ─── Streak ─── */
.streak-display { text-align: center; padding: 20px; }
.streak-num {
  font-size: 64px; font-weight: 900; line-height: 1;
  background: linear-gradient(180deg, #fbbf24, #f97316, #ef4444);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
  animation: flame 1.5s ease-in-out infinite alternate;
}
@keyframes flame { from { transform: scale(1); } to { transform: scale(1.05); } }
.streak-label { font-size: 13px; color: #64748b; margin-top: 6px; font-weight: 500; }
.streak-bar { display: flex; gap: 6px; justify-content: center; margin: 14px 0; }
.streak-day {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(148,163,184,.12);
  transition: all .3s;
}
.streak-day.active {
  background: linear-gradient(135deg, #fbbf24, #f97316);
  border-color: transparent; color: #0a0e1a; font-weight: 800;
  box-shadow: 0 0 16px rgba(251,191,36,.3);
  animation: streakPop .3s ease;
}
@keyframes streakPop { 0% { transform: scale(.8); } 50% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* ─── Progress ─── */
.progress-bar { height: 8px; background: rgba(255,255,255,.06); border-radius: 4px; overflow: hidden; margin: 8px 0; }
.progress-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, #22d3ee, #a78bfa, #f472b6);
  background-size: 200% auto;
  animation: progMove 3s ease infinite;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
@keyframes progMove { 0%,100% { background-position: 0% center; } 50% { background-position: 100% center; } }
.progress-label { display: flex; justify-content: space-between; font-size: 11px; color: #64748b; margin: 4px 0; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 24px; border: none; border-radius: 12px;
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  width: 100%; transition: all .2s cubic-bezier(.4,0,.2,1);
}
.btn:active { transform: scale(.95); }
.btn-primary {
  background: linear-gradient(135deg, #22d3ee, #06b6d4);
  color: #0a0e1a; box-shadow: 0 4px 20px rgba(34,211,238,.25);
}
.btn-primary:hover { box-shadow: 0 6px 28px rgba(34,211,238,.35); transform: translateY(-1px); }
.btn-sm { padding: 7px 14px; font-size: 12px; width: auto; border-radius: 8px; }

/* ─── Shop Grid ─── */
.shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shop-item {
  background: rgba(30,41,59,.5);
  border: 1px solid rgba(148,163,184,.08);
  border-radius: 14px; padding: 16px 10px;
  text-align: center; cursor: pointer;
  transition: all .3s cubic-bezier(.4,0,.2,1);
}
.shop-item:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.shop-item .emoji { font-size: 36px; display: block; margin-bottom: 8px; transition: transform .3s; }
.shop-item:hover .emoji { transform: scale(1.2) rotate(-8deg); }
.shop-item .name { font-size: 13px; font-weight: 600; color: #f1f5f9; }
.shop-item .price {
  font-size: 12px; font-weight: 700; color: #fbbf24; margin-top: 4px;
}
.shop-item.owned {
  border-color: rgba(34,197,94,.3);
  background: rgba(34,197,94,.1);
}
.shop-item.owned .price { color: #22c55e; }

/* ─── Quest ─── */
.quest-banner {
  background: linear-gradient(135deg, #1e1b4b, #312e81, #1e1b4b);
  background-size: 200% 200%;
  animation: bgShift 6s ease infinite;
  border: 1px solid rgba(167,139,250,.2);
  border-radius: 16px; padding: 16px; margin-bottom: 12px;
  text-align: center;
}
.quest-banner .title { font-size: 14px; font-weight: 700; color: #a78bfa; }
.quest-banner .sub { font-size: 12px; color: #94a3b8; margin-top: 4px; }

.quest-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid rgba(148,163,184,.06);
}
.quest-item:last-child { border-bottom: none; }
.quest-check {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid rgba(148,163,184,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
  transition: all .3s;
}
.quest-check.done {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border-color: transparent; color: #fff;
  box-shadow: 0 0 12px rgba(34,197,94,.3);
}
.quest-info { flex: 1; }
.quest-info .desc { font-size: 13px; font-weight: 600; }
.quest-info .prog { font-size: 11px; color: #64748b; margin-top: 3px; }
.quest-reward { font-size: 13px; color: #fbbf24; font-weight: 700; }

/* ─── Log ─── */
.log-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px; border-bottom: 1px solid rgba(148,163,184,.06);
  border-radius: 10px;
  transition: background .2s;
}
.log-item:hover { background: rgba(255,255,255,.03); }
.log-item:last-child { border-bottom: none; }
.log-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: rgba(34,211,238,.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.log-body { flex: 1; }
.log-body .log-type { font-size: 11px; color: #22d3ee; font-weight: 600; }
.log-body .log-desc { font-size: 13px; margin: 4px 0 2px; font-weight: 500; }
.log-body .log-detail { font-size: 11px; color: #64748b; }
.log-coins {
  font-size: 14px; font-weight: 700; color: #fbbf24;
  align-self: center;
}

/* ─── Form ─── */
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 12px; font-weight: 500; color: #94a3b8; margin-bottom: 5px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid rgba(148,163,184,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  color: #f1f5f9;
  font-family: inherit; font-size: 14px;
  transition: border-color .2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: #22d3ee;
  box-shadow: 0 0 0 3px rgba(34,211,238,.1);
}
.form-textarea { min-height: 80px; resize: vertical; }

/* ─── Toast ─── */
.toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
  background: rgba(15,23,42,.95); backdrop-filter: blur(16px);
  border: 1px solid rgba(34,197,94,.2);
  border-radius: 14px; padding: 12px 20px; font-size: 13px; z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  animation: toasts .35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes toasts { from { opacity: 0; transform: translateX(-50%) translateY(16px) scale(.8); } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }

/* ─── Sync Bar ─── */
.sync-bar {
  position: fixed; bottom: 76px; left: 50%; transform: translateX(-50%);
  background: rgba(30,41,59,.8); backdrop-filter: blur(16px);
  border: 1px solid rgba(148,163,184,.1);
  border-radius: 20px; padding: 6px 16px;
  font-size: 11px; color: #64748b;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap; z-index: 50;
}
.sync-dot { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; display: inline-block; animation: dotPulse 2s infinite; }
@keyframes dotPulse { 0%,100% { opacity: 1; box-shadow: 0 0 4px rgba(34,197,94,.5); } 50% { opacity: .4; } }

/* ─── Empty state ─── */
.empty-state { text-align: center; padding: 40px 16px; color: #64748b; }
.empty-state .icon { font-size: 56px; margin-bottom: 12px; display: block; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.modal-box {
  background: #1e293b;
  border-radius: 16px; padding: 24px;
  width: 100%; max-width: 400px;
  border: 1px solid rgba(148,163,184,.12);
  box-shadow: 0 16px 48px rgba(0,0,0,.5);
  animation: modalPop .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes modalPop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }
.modal-box h2 { font-size: 18px; font-weight: 700; margin-bottom: 16px; color: #f1f5f9; }

/* ─── Login ─── */
.login-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 90vh; text-align: center; padding: 0 16px; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,.15); border-radius: 2px; }
