/* Simya Ligi - sicak simyaci atolyesi (M2: giris + Dukkan). */
:root {
  --ink: #f3e7d3;
  --ink-dim: #c1ad8e;
  --ink-mute: #9a866a;
  --wood-0: #17100a;
  --wood-1: #241a10;
  --wood-2: #33251699;
  --panel: #2c2013;
  --panel-2: #34281a;
  --ember: #e8a13c;
  --ember-2: #f5c877;
  --glass: #7fb7a6;
  --line: #4a3623;
  --danger: #d9765a;
  --ok: #8fc07a;
  font-family: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(130% 60% at 50% -8%, #6b4a26 0%, rgba(107, 74, 38, 0) 60%),
    linear-gradient(180deg, var(--wood-1), var(--wood-0));
  background-attachment: fixed;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* uçuşan toz zerreleri */
.motes { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.motes i {
  position: absolute; bottom: -10px; width: 3px; height: 3px; border-radius: 50%;
  background: radial-gradient(circle, #f5c87799, #f5c87700);
  animation: drift linear infinite;
}
.motes i:nth-child(1){left:8%;animation-duration:19s;animation-delay:-2s}
.motes i:nth-child(2){left:18%;animation-duration:24s;animation-delay:-9s;width:2px;height:2px}
.motes i:nth-child(3){left:27%;animation-duration:16s;animation-delay:-4s}
.motes i:nth-child(4){left:38%;animation-duration:27s;animation-delay:-14s;width:4px;height:4px}
.motes i:nth-child(5){left:46%;animation-duration:21s;animation-delay:-1s}
.motes i:nth-child(6){left:55%;animation-duration:18s;animation-delay:-11s;width:2px;height:2px}
.motes i:nth-child(7){left:63%;animation-duration:25s;animation-delay:-6s}
.motes i:nth-child(8){left:71%;animation-duration:15s;animation-delay:-3s;width:4px;height:4px}
.motes i:nth-child(9){left:80%;animation-duration:23s;animation-delay:-16s}
.motes i:nth-child(10){left:87%;animation-duration:20s;animation-delay:-8s;width:2px;height:2px}
.motes i:nth-child(11){left:93%;animation-duration:17s;animation-delay:-5s}
.motes i:nth-child(12){left:33%;animation-duration:29s;animation-delay:-19s}
@keyframes drift {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: .8; }
  90% { opacity: .5; }
  100% { transform: translateY(-102vh) translateX(24px); opacity: 0; }
}
#app { position: relative; z-index: 1; }
.top { position: sticky; }

body.flash::after {
  content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background: radial-gradient(circle at 50% 45%, #d9b4ff88, #d9b4ff00 60%);
  animation: flashfade .7s ease-out forwards;
}
@keyframes flashfade { from { opacity: 1; } to { opacity: 0; } }

.screen-in { animation: screenin .26s ease; }
@keyframes screenin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .motes, .screen-in, body.flash::after { animation: none; }
  .motes { display: none; }
}
button { font-family: inherit; cursor: pointer; color: inherit; }
input { font-family: inherit; }
.ic { width: 20px; height: 20px; flex: none; color: var(--ember-2); }

/* ---------- boot ---------- */
.boot { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.boot-mark { font-size: 60px; filter: drop-shadow(0 0 18px rgba(232, 161, 60, .5)); animation: bob 3.2s ease-in-out infinite; }
.boot-mark.sm { font-size: 40px; margin-bottom: 2px; }
.boot-note { color: var(--ink-mute); letter-spacing: 2px; font-size: 13px; }
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }
@media (prefers-reduced-motion: reduce) { .boot-mark { animation: none } }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px;
  padding: 26px 22px; border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45), inset 0 1px 0 #ffffff12;
  text-align: center;
}
.auth-card h1 { margin: 0 0 4px; font-size: 26px; color: var(--ember-2); }
.fld { display: flex; flex-direction: column; gap: 5px; text-align: left; font-size: 12px; color: var(--ink-dim); letter-spacing: .5px; }
.fld input {
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: #1c140c; color: var(--ink); font-size: 15px;
}
.fld input:focus { outline: 2px solid var(--ember); outline-offset: 0; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-dim); }
.chk input { width: 16px; height: 16px; accent-color: var(--ember); }
.btn-primary {
  padding: 12px 14px; border: 1px solid var(--ember); border-radius: 10px;
  background: linear-gradient(180deg, var(--ember-2), var(--ember)); color: #2a1a08;
  font-weight: 800; letter-spacing: .5px; font-size: 15px;
}
.btn-primary:disabled { opacity: .5; cursor: default; }
.btn-primary.sm { padding: 8px 12px; font-size: 13px; }
.link { background: none; border: 0; color: var(--ember-2); font-size: 13px; text-decoration: underline; padding: 4px; }

/* ---------- game shell ---------- */
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: 12px 14px calc(12px + env(safe-area-inset-top)); padding-top: max(12px, env(safe-area-inset-top));
  background: linear-gradient(180deg, #2a1e12, #2a1e1200); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; color: var(--ember-2); }
.brand .logo { font-size: 20px; display: inline-block; animation: flicker 3.5s ease-in-out infinite; filter: drop-shadow(0 0 6px #e8a13c66); }
@keyframes flicker { 0%,100% { opacity: 1; } 45% { opacity: .82; } 60% { opacity: 1; } 75% { opacity: .9; } }
.purse { position: relative; margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 17px; }
.gold-float {
  position: absolute; right: 0; top: -4px; color: var(--ok); font-weight: 800; font-size: 14px;
  pointer-events: none; animation: goldup .9s ease-out forwards;
}
@keyframes goldup { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-22px); } }
.purse b { font-variant-numeric: tabular-nums; }
.logout { background: none; border: 1px solid var(--line); border-radius: 8px; width: 34px; height: 34px; font-size: 15px; color: var(--ink-dim); }

.game { max-width: 560px; margin: 0 auto; padding: 14px 14px calc(84px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }

/* ---------- bottom nav ---------- */
.botnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 8;
  display: flex; justify-content: center; gap: 6px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, #241a10, #241a10ee 70%, #241a1000);
  border-top: 1px solid var(--line);
}
.nav {
  flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px; border: 1px solid transparent; border-radius: 10px;
  background: none; color: var(--ink-mute); font-size: 11px; letter-spacing: 1px;
}
.nav .nav-g { font-size: 19px; line-height: 1; }
.nav.on { color: var(--ember-2); border-color: var(--line); background: #ffffff0a; }

/* ---------- pazar ---------- */
.mk-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.mk-row:first-child { border-top: 0; }
.mk-row.hot { background: #e8a13c10; margin: 0 -6px; padding-left: 6px; padding-right: 6px; border-radius: 8px; }
.mk-main { flex: 1; min-width: 0; }
.mk-name { font-size: 14px; font-weight: 600; }
.mk-sub { font-size: 13px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.mk-sub .up { color: var(--ok); }
.mk-sub .down { color: var(--danger); }
.mk-spark { width: 84px; height: 30px; flex: none; opacity: .9; }
.spark { width: 100%; height: 100%; display: block; }
.mk-lock { width: 62px; text-align: center; opacity: .6; }
.mk-row .btn-sell { min-width: 62px; }
.card {
  border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: 0 14px 34px rgba(0, 0, 0, .35), inset 0 1px 0 #ffffff10;
}
.card h2 { margin: 0 0 10px; font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--ink-mute); }
.muted { color: var(--ink-mute); font-size: 12px; margin: 0 0 10px; }

/* ---------- cauldron ---------- */
.cauldron { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.cauldron-pot {
  position: relative; width: 104px; height: 104px; flex: none; border-radius: 50%;
  border: 2px solid var(--ember); padding: 0;
  background: radial-gradient(circle at 50% 30%, #3a2c1a, #241a10 65%, #17100a);
  box-shadow: 0 0 26px #e8a13c33, inset 0 -10px 20px #0008;
  display: grid; place-items: center; transition: transform .08s ease;
}
.cauldron-svg { width: 78px; height: 78px; }
.brew-liquid { fill: #6fd39a; animation: brewglow 2.6s ease-in-out infinite; }
@keyframes brewglow { 0%,100% { fill: #5cba86; } 50% { fill: #86e6ac; } }
.bub { fill: #b9f2d0; opacity: 0; }
.bub.b1 { animation: bubrise 2.2s ease-in infinite; }
.bub.b2 { animation: bubrise 2.7s ease-in infinite .5s; }
.bub.b3 { animation: bubrise 1.9s ease-in infinite 1s; }
@keyframes bubrise {
  0% { opacity: 0; transform: translateY(0) scale(.6); }
  30% { opacity: .9; }
  100% { opacity: 0; transform: translateY(-12px) scale(1); }
}
.cauldron-pot:active { transform: scale(.94); }
.cauldron-pot.pop { animation: pop .28s ease; }
@keyframes pop { 40% { transform: scale(1.08); box-shadow: 0 0 40px #7fe0aa; } }
.steam {
  position: absolute; top: -10px; left: 50%; width: 10px; height: 22px; transform: translateX(-50%);
  background: radial-gradient(circle, #ffffff55, #fff0); border-radius: 50%; filter: blur(2px);
  animation: rise 2.4s ease-in-out infinite;
}
@keyframes rise { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.6) } 50% { opacity: .8 } 100% { opacity: 0; transform: translate(-50%, -16px) scale(1.3) } }
.cauldron-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.brew-name { font-size: 17px; font-weight: 700; color: var(--ember-2); }
.brew-have { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.btn-tap {
  width: 100%; padding: 13px; border: 1px solid var(--ember); border-radius: 11px;
  background: linear-gradient(180deg, #3a5a3f, #2a4230); color: var(--ember-2);
  font-weight: 800; letter-spacing: 2px; font-size: 15px; margin-bottom: 10px;
}
.btn-tap:active { transform: translateY(1px); }

/* ---------- kazan listesi ---------- */
.cauls { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.caul { padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: #ffffff08; display: flex; flex-direction: column; gap: 6px; }
.caul-h { display: flex; align-items: center; gap: 8px; }
.caul-name { flex: 1; font-size: 14px; font-weight: 600; }
.caul-sub { font-size: 11px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }

/* ---------- upgrade buttons ---------- */
.btn-up {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  background: #241a10; color: var(--ink); font-size: 14px;
}
.btn-up .cost { display: flex; align-items: center; gap: 5px; color: var(--ember-2); font-variant-numeric: tabular-nums; }
.btn-up .cost .ic { width: 16px; height: 16px; }
.btn-up.mini { padding: 8px 10px; font-size: 13px; width: auto; }
.btn-up.cant { opacity: .55; }
.btn-up:not(.cant):active { transform: translateY(1px); border-color: var(--ember); }

/* ---------- gunluk giris ---------- */
.login-banner {
  width: 100%; text-align: left; padding: 11px 13px; border-radius: 11px;
  border: 1px solid var(--ember); background: linear-gradient(180deg, #3a2c17, #2c2013);
  color: var(--ink); font-size: 13px;
}
.login-banner b { color: var(--ember-2); }
.login-track { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin: 10px 0; }
.login-day { padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: #ffffff08; display: flex; flex-direction: column; gap: 3px; }
.login-day b { font-size: 12px; color: var(--ink-dim); }
.login-day span { font-size: 11px; color: var(--ink-mute); }
.login-day.next { border-color: var(--ember); box-shadow: 0 0 0 1px var(--ember) inset; }
.login-day.gold b { color: var(--ember-2); }
.away-lines { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; font-size: 13px; }

/* ---------- siparis tahtasi ---------- */
.orders { display: flex; flex-direction: column; gap: 10px; }
.ord { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #ffffff08; display: flex; flex-direction: column; gap: 7px; }
.ord.empty { align-items: center; padding: 14px; border-style: dashed; }
.ord-top { display: flex; align-items: center; gap: 8px; }
.ord-name { flex: 1; font-size: 14px; font-weight: 600; }
.ord-rew { font-size: 12px; color: var(--ember-2); white-space: nowrap; }
.ord-bar { height: 6px; border-radius: 3px; background: #0004; overflow: hidden; }
.ord-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ember), var(--ember-2)); transition: width .3s ease; }
.ord-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ord-foot .muted { font-size: 11px; }
.ord-btns { display: flex; align-items: center; gap: 8px; white-space: nowrap; }

/* ---------- prestij ---------- */
.btn-prestige {
  width: 100%; padding: 12px; margin-bottom: 12px;
  border: 1px solid #9a7bd0; border-radius: 11px;
  background: linear-gradient(180deg, #6b4ea8, #4a3480); color: #f0e6ff;
  font-weight: 800; letter-spacing: 2px; font-size: 14px;
}
.btn-prestige:disabled { opacity: .45; cursor: default; }
.btn-prestige.armed { background: linear-gradient(180deg, #d97b5a, #b5543a); border-color: #e89a7c; }
.wisdom { display: flex; flex-direction: column; gap: 8px; }
.wiz-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; background: #7a5fd010; }
.wiz-main { flex: 1; min-width: 0; }
.wiz-name { font-size: 13px; font-weight: 600; }
.wiz-sub { font-size: 11px; color: var(--ink-mute); }
.wiz-max { font-size: 11px; color: var(--ink-mute); }

/* ---------- shelf ---------- */
.shelf { display: flex; flex-direction: column; gap: 8px; }
.shelf-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; background: #ffffff08; }
.shelf-row .sr-name { flex: 1; font-size: 14px; }
.shelf-row .sr-val { color: var(--ink-dim); font-size: 13px; font-variant-numeric: tabular-nums; }
.shelf-row.potion { background: #7fb7a614; }
.btn-sell {
  padding: 7px 11px; border: 1px solid var(--ember); border-radius: 8px;
  background: linear-gradient(180deg, var(--ember-2), var(--ember)); color: #2a1a08;
  font-weight: 800; font-size: 12px; letter-spacing: .5px; white-space: nowrap;
}
.btn-sell:disabled { opacity: .4; cursor: default; filter: grayscale(.5); }

/* ---------- stations ---------- */
.st-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.st-row:first-child { border-top: 0; }
.st-row.locked { opacity: .7; }
.st-main { flex: 1; min-width: 0; }
.st-name { font-size: 14px; font-weight: 600; }
.st-sub { font-size: 12px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; z-index: 20; background: #000a; display: grid; place-items: end center; }
.modal {
  width: 100%; max-width: 560px; max-height: 82dvh; overflow: auto;
  border: 1px solid var(--line); border-radius: 16px 16px 0 0; padding: 16px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}
.modal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-h h2 { margin: 0; font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: var(--ink-mute); }
.x { background: none; border: 1px solid var(--line); border-radius: 8px; width: 30px; height: 30px; color: var(--ink-dim); }
.rec-list { display: flex; flex-direction: column; gap: 10px; }
.rec { padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #241a10; display: flex; flex-direction: column; gap: 7px; }
.rec.active { border-color: var(--ember); box-shadow: 0 0 0 1px var(--ember) inset; }
.rec-h { display: flex; justify-content: space-between; align-items: baseline; }
.rec-price { color: var(--ember-2); font-size: 12px; }
.rec-in { font-size: 12px; }

/* ---------- lig ---------- */
.lg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.lg-tier { font-size: 15px; }
.lg-tier b { color: var(--ember-2); font-size: 18px; }
.lg-clock { text-align: right; font-size: 13px; }
.lg-clock .muted { display: block; font-size: 10px; letter-spacing: 1px; }
.lg-clock b { font-variant-numeric: tabular-nums; color: var(--ember-2); }
.lg-list { display: flex; flex-direction: column; margin-top: 6px; }
.lg-row { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-top: 1px solid var(--line); font-size: 14px; }
.lg-row:first-child { border-top: 0; }
.lg-rank { width: 22px; text-align: center; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.lg-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-name .lg-bot { color: var(--ink-mute); font-size: 11px; font-style: normal; }
.lg-name .lg-me { color: var(--ember-2); font-size: 11px; font-style: normal; }
.lg-rev { font-variant-numeric: tabular-nums; color: var(--ink-dim); }
.lg-row.you { background: #e8a13c14; margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 6px; }
.lg-row.promote .lg-rank { color: var(--ok); }
.lg-row.promote .lg-rank::after { content: " ▲"; font-size: 9px; }
.lg-row.relegate .lg-rank { color: var(--danger); }
.lg-row.relegate .lg-rank::after { content: " ▼"; font-size: 9px; }

/* ---------- stepper + kesif tezgahi + bulmaca ---------- */
.stepper { display: flex; align-items: center; gap: 6px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 9px; background: #1c140c; }
.stepper .ic { width: 18px; height: 18px; }
.stp-b { width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 7px; background: #2a1e12; color: var(--ink); font-size: 16px; line-height: 1; }
.stp-b:active { background: var(--ember); color: #201404; }
.stp-n { min-width: 16px; text-align: center; font-variant-numeric: tabular-nums; }

.bench { margin: 8px 0; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; display: flex; flex-direction: column; gap: 8px; }
.bench-row { display: flex; gap: 6px; flex-wrap: wrap; }
.bench-log { display: flex; flex-direction: column; gap: 4px; }

.pz-board { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.pz-guesses { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.pz-g { display: flex; gap: 8px; }
.pz-g.sm { gap: 5px; }
.pz-cell { display: flex; align-items: center; gap: 4px; padding: 5px 9px; border-radius: 8px; background: #ffffff0a; border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.pz-cell .ic { width: 16px; height: 16px; }
.pz-cell i { font-style: normal; font-size: 12px; color: var(--ink-mute); }
.pz-cell.ok { background: #8fc07a22; border-color: #8fc07a66; }
.pz-cell.ok i { color: var(--ok); }
.pz-cell.more i, .pz-cell.less i { color: var(--ember-2); }
.pz-streak { font-size: 13px; color: var(--ink-dim); margin-bottom: 6px; }
.pz-result { margin-top: 10px; font-size: 14px; color: var(--ember-2); }
.pz-lb { display: flex; flex-direction: column; }
.pz-lb-row { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-top: 1px solid var(--line); font-size: 13px; }
.pz-lb-row:first-child { border-top: 0; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 40; padding: 10px 16px; border-radius: 10px; font-size: 13px;
  background: #3a2a1a; border: 1px solid var(--ember); color: var(--ink);
  box-shadow: 0 10px 30px #0007; max-width: 90vw; text-align: center;
}
.toast[hidden] { display: none; }
