/* Dragon Pet Game — teal lagoon theme (NOT deep purple) */
:root {
  --bg: #062e2a;
  --bg2: #08403a;
  --panel: #0f5d52;
  --panel2: #147266;
  --panel3: #1b8577;
  --line: #2aa897;
  --line-soft: #1e7a6d;
  --text: #f2fffb;
  --muted: #bfe8de;
  --gold: #f6c453;
  --gold-dark: #d99a1f;
  --coral: #ff8a6b;
  --coral-dark: #e05f3f;
  --mint: #8fe3cf;
  --danger: #ff6b6b;
  --radius: 18px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #0d4a41 0%, var(--bg) 55%, #04201d 100%);
  color: var(--text);
  min-height: 100vh;
}
#app { max-width: 430px; margin: 0 auto; min-height: 100vh; padding: 12px 12px 96px; position: relative; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 6px 2px 12px; }
.topbar .brand { font-weight: 800; font-size: 18px; letter-spacing: .2px; }
.topbar .brand small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.chip { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; font-weight: 700; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.chip .coin { width: 16px; height: 16px; }
.demo-note { background: #3a2f00; border: 1px solid var(--gold); color: #ffe9a8; border-radius: 12px; padding: 9px 12px; font-size: 12px; margin-bottom: 10px; }
.card { background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.card h2 { font-size: 16px; margin-bottom: 8px; }
.card p { font-size: 13px; color: var(--muted); line-height: 1.55; }
.card p b, .card p strong { color: var(--text); }
.gold-text { color: var(--gold); }
.muted { color: var(--muted); font-size: 12px; }
.hidden { display: none !important; }

/* Dragon stage */
.dragon-card { text-align: center; position: relative; overflow: hidden; }
.dragon-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(300px 180px at 50% 30%, rgba(143,227,207,.28), transparent 70%); pointer-events: none; }
.food-row { display: flex; justify-content: space-between; gap: 6px; margin: 6px 0 2px; position: relative; }
.food-slot { flex: 1; background: rgba(0,0,0,.22); border: 1px solid var(--line-soft); border-radius: 12px; padding: 6px 2px 5px; min-height: 62px; position: relative; overflow: hidden; }
.food-slot .fill { position: absolute; left: 0; bottom: 0; width: 100%; background: rgba(246,196,83,.35); transition: height .25s ease; }
.food-slot svg { width: 28px; height: 28px; position: relative; }
.food-slot .fname { font-size: 9px; color: var(--muted); position: relative; display: block; margin-top: 1px; }
.food-slot .fpct { font-size: 10px; font-weight: 800; color: var(--gold); position: relative; }
.food-slot.ready { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.dragon-stage { position: relative; padding: 8px 0 2px; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.dragon-wrap { display: inline-block; transition: transform .9s ease; transform-origin: 50% 100%; will-change: transform; }
.dragon-wrap.squash { animation: squash .35s ease; }
@keyframes squash { 0% { transform: scale(1,1); } 40% { transform: scale(1.08,.92); } 100% { transform: scale(1,1); } }
.dragon-svg { width: 150px; height: 150px; display: block; filter: drop-shadow(0 10px 18px rgba(0,0,0,.35)); }
.nest { width: 180px; height: 26px; margin: -14px auto 0; position: relative; }
.click-here { font-size: 14px; font-weight: 700; color: var(--gold); margin-top: 6px; }
.dragon-footer { margin-top: 12px; border-top: 1px solid var(--line-soft); padding-top: 10px; text-align: center; }
.dragon-footer .dname { font-weight: 800; font-size: 15px; }
.dragon-footer .dstatus { font-size: 12px; color: var(--muted); margin-top: 2px; }
.floater { position: absolute; color: var(--gold); font-weight: 800; font-size: 14px; pointer-events: none; animation: floatUp 1s ease forwards; }
@keyframes floatUp { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-34px); } }

/* Bars, tiles */
.bar { height: 10px; background: rgba(0,0,0,.35); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--coral)); border-radius: 999px; transition: width .5s ease; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.tile { background: rgba(0,0,0,.22); border: 1px solid var(--line-soft); border-radius: 12px; padding: 10px; }
.tile .t-label { font-size: 11px; color: var(--muted); }
.tile .t-val { font-size: 17px; font-weight: 800; margin-top: 2px; }
.evo-path { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12px; margin-top: 8px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 2px solid rgba(255,255,255,.6); }

/* Buttons */
.btn { display: block; width: 100%; border: none; border-radius: 14px; padding: 13px 16px; font-size: 15px; font-weight: 800; cursor: pointer; text-align: center; text-decoration: none; }
.btn-gold { background: linear-gradient(180deg, var(--gold), var(--gold-dark)); color: #3a2500; }
.btn-teal { background: var(--panel3); color: #fff; border: 1px solid var(--line); }
.btn-coral { background: linear-gradient(180deg, var(--coral), var(--coral-dark)); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: 9px 12px; font-size: 13px; width: auto; display: inline-block; }
input, select, textarea { width: 100%; background: rgba(0,0,0,.3); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 11px 12px; font-size: 14px; margin: 6px 0; }
input::placeholder { color: #7fb8ab; }
label { font-size: 12px; color: var(--muted); display: block; margin-top: 8px; }

/* Lists */
.item { background: rgba(0,0,0,.22); border: 1px solid var(--line-soft); border-radius: 12px; padding: 11px 12px; margin-top: 8px; }
.item .row { align-items: flex-start; }
.badge { font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 999px; background: var(--panel3); border: 1px solid var(--line); white-space: nowrap; }
.badge.gold { background: rgba(246,196,83,.25); color: var(--gold); border-color: var(--gold); }
.badge.green { background: rgba(143,227,207,.2); color: var(--mint); border-color: var(--mint); }
.badge.red { background: rgba(255,107,107,.18); color: var(--danger); border-color: var(--danger); }

/* Bottom bar + sheet */
.bottombar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 430px; background: rgba(6,46,42,.97); border-top: 1px solid var(--line); display: flex; padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); z-index: 40; }
.tab { flex: 1; background: none; border: none; color: var(--muted); font-size: 11px; font-weight: 700; padding: 6px 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--gold); }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50; }
.sheet { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 430px; background: var(--bg2); border: 1px solid var(--line); border-bottom: none; border-radius: 20px 20px 0 0; padding: 14px 14px 22px; z-index: 51; }
.sheet-item { display: flex; gap: 12px; align-items: center; width: 100%; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 14px; padding: 13px; margin-top: 8px; cursor: pointer; text-align: left; }
.sheet-item svg { width: 22px; height: 22px; flex-shrink: 0; }
.sheet-item small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }

/* Toast / popup */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 88px; background: var(--panel3); border: 1px solid var(--line); color: #fff; padding: 11px 16px; border-radius: 999px; font-size: 13px; font-weight: 700; z-index: 60; box-shadow: 0 8px 24px rgba(0,0,0,.4); max-width: 90%; text-align: center; }
.popup-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 70; display: flex; align-items: center; justify-content: center; padding: 20px; }
.popup { background: var(--bg2); border: 1px solid var(--line); border-radius: 20px; padding: 20px; max-width: 360px; width: 100%; text-align: center; }
.popup h3 { margin-bottom: 8px; }
.ad-slot { border: 1px dashed var(--gold); border-radius: 12px; padding: 12px; text-align: center; font-size: 12px; color: var(--muted); margin-top: 10px; }
.streak-banner { background: linear-gradient(90deg, #7a5a00, #b98a12); border: 1px solid var(--gold); border-radius: 14px; padding: 12px; text-align: center; font-weight: 800; margin-bottom: 10px; }
.history li { list-style: none; font-size: 13px; padding: 7px 2px; border-bottom: 1px solid var(--line-soft); display: flex; justify-content: space-between; }
.link { color: var(--gold); text-decoration: underline; cursor: pointer; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
th, td { text-align: left; padding: 7px 4px; border-bottom: 1px solid var(--line-soft); }
@media (max-width: 360px) { .dragon-svg { width: 128px; height: 128px; } }
