/* Palet ve yazı tipleri: art-ref/brand (sanat.md). */
:root {
  --bg: #0f1114;
  --surface: #1c2025;
  --surface-2: #262b31;
  --line: #3a4148;
  --line-strong: #6b7580;
  --text: #ede7db;
  --text-2: #9c978c;
  --accent: #f2a23a;
  --blue: #86a9d6;
  --red: #ef5b57;
  --green: #6fbf8e;
  --font-head: 'Barlow Condensed', system-ui, sans-serif;
  --font-body: 'Barlow', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; background: var(--bg); color: var(--text); }
body { font-family: var(--font-body); font-size: 14px; overflow: hidden; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

#app {
  height: 100dvh; display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "hud hud" "stage side";
  gap: 10px; padding: max(10px, env(safe-area-inset-top)) 14px max(10px, env(safe-area-inset-bottom));
}

.hud { grid-area: hud; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand { margin-right: auto; }
.brand h1 { display: flex; align-items: center; gap: 6px; }
.brand-mark { width: 30px; height: 30px; flex: none; margin-left: -3px; }
.kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; color: var(--accent); text-transform: uppercase; }
h1 { font-family: var(--font-head); font-weight: 700; font-size: 28px; line-height: 1; }
.label { font-size: 11px; color: var(--text-2); display: block; }
.stat { min-width: 84px; }
.num { font-family: var(--font-mono); font-weight: 600; font-size: 24px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.num.sm { font-size: 18px; }
.unit { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); margin-left: 3px; }
.mono { font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-2); }
.net-chip { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); line-height: 1.5; border-left: 1px solid var(--line); padding-left: 12px; }
.net-chip b { color: var(--text); font-weight: 500; }
.claim { display: grid; grid-template-columns: 190px auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; }
.claim-top { display: flex; justify-content: space-between; gap: 8px; }
.bar { height: 7px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
#watchFill { height: 100%; width: 100%; background: var(--green); transition: width 300ms linear; }
#watchFill.low { background: var(--accent); }
#watchFill.out { background: var(--red); }
#claim { grid-column: 2; grid-row: 1 / span 2; }
.wallet-pill { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--text); background: transparent; border: 1px solid var(--line-strong); border-radius: 999px; min-height: 36px; padding: 0 14px; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.wallet-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-2); flex: none; }
.wallet-pill.on { border-color: var(--green); }
.wallet-pill.on .dot { background: var(--green); box-shadow: 0 0 6px var(--green); }
.wallet-pill.connect, .wallet-pill.get { background: var(--accent); color: #16191d; border-color: var(--accent); font-family: var(--font-body, inherit); font-size: 13px; font-weight: 700; }

.primary { background: var(--accent); color: #16191d; border: 0; border-radius: 4px; min-height: 44px; padding: 0 16px; font-weight: 700; }
.primary:disabled { opacity: 0.4; cursor: default; }
.ghost { background: transparent; border: 1px solid var(--line-strong); border-radius: 4px; min-height: 40px; padding: 0 12px; font-weight: 600; }
.ghost:disabled { opacity: 0.4; cursor: default; }
.small { min-height: 36px; padding: 0 10px; font-size: 13px; }

.stage { grid-area: stage; position: relative; min-height: 0; border-radius: 6px; overflow: hidden; background: #0b0d10; }
#scene { width: 100%; height: 100%; display: block; touch-action: none; }
.view-btns { position: absolute; right: 10px; bottom: 28px; display: flex; gap: 6px; }
.view-btns button { background: rgba(20, 23, 27, 0.85); }
.hint { position: absolute; right: 10px; bottom: 8px; font-size: 11px; color: var(--text-2); pointer-events: none; opacity: 0.8; }
.toast { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--accent); border-radius: 4px; padding: 8px 14px; font-family: var(--font-mono); font-size: 13px; pointer-events: none; max-width: 90%; text-align: center; }
.card-panel { position: absolute; left: 12px; bottom: 12px; width: min(320px, calc(100% - 24px)); background: rgba(20, 23, 27, 0.94); border: 1px solid var(--line-strong); border-radius: 6px; padding: 12px 14px; display: grid; gap: 8px; }
.card-panel h3 { font-family: var(--font-head); font-size: 22px; display: flex; align-items: center; gap: 8px; }
.card-panel .row { display: flex; gap: 8px; }
.card-panel .row button { flex: 1; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 13px; }
.kv span:nth-child(odd) { color: var(--text-2); }
.kv span:nth-child(even) { font-family: var(--font-mono); text-align: right; }
.swatch { width: 12px; height: 12px; border-radius: 2px; display: inline-block; flex: none; }
.good { color: var(--green); }
.bad { color: var(--red); }
.warn { color: var(--accent); }
.trend { font-size: 11px; margin-left: 4px; }
.trend.up { color: var(--red); }
.trend.down { color: var(--green); }
.market-strip { border-style: dashed; }
.market-strip b { color: var(--text); }

.side { grid-area: side; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.tabs button { min-height: 40px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; font-weight: 600; }
.tabs button[aria-selected="true"] { border-color: var(--accent); color: var(--accent); }
.tab-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 2px; }
.section-title { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; color: var(--text-2); text-transform: uppercase; margin-top: 4px; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.item.offer { border-color: rgba(242, 162, 58, 0.5); }
.item.locked { opacity: 0.55; }
.item .name { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.item .meta { grid-column: 1; font-family: var(--font-mono); font-size: 11px; color: var(--text-2); line-height: 1.5; }
.item .buy { grid-column: 2; grid-row: 1 / span 2; display: grid; justify-items: end; gap: 4px; }
.price { font-family: var(--font-mono); font-weight: 600; font-size: 14px; }
.price s { color: var(--text-2); font-weight: 400; font-size: 11px; margin-right: 4px; }
.tag { font-family: var(--font-mono); font-size: 10px; padding: 1px 5px; border-radius: 3px; background: var(--surface-2); color: var(--accent); }
.progress { height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden; grid-column: 1 / -1; }
.progress div { height: 100%; background: var(--blue); }
.credit { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); text-decoration: none; margin-top: auto; padding-top: 4px; }
.credit:hover { color: var(--text); }
.credit img { width: 22px; height: 22px; }
.debug { border-top: 1px solid var(--line); padding-top: 6px; font-size: 12px; color: var(--text-2); }
.debug summary { cursor: pointer; min-height: 28px; }
.debug .row { display: flex; align-items: center; gap: 4px; margin: 6px 0; }
.debug .label { display: inline; margin-right: auto; }
.speed { min-height: 32px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 4px; background: transparent; }
.speed[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

dialog { margin: auto; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 6px; padding: 22px; max-width: min(460px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(8, 10, 12, 0.7); }
dialog h2 { font-family: var(--font-head); font-size: 26px; margin-bottom: 8px; }
dialog p { line-height: 1.5; color: var(--text-2); margin-bottom: 12px; }
dialog p b { color: var(--text); font-family: var(--font-mono); }
dialog .primary { width: 100%; }
.dlg-credit { display: flex; align-items: center; gap: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }

@media (max-width: 1100px) and (min-width: 761px) {
  #app { grid-template-columns: minmax(0, 1fr) 320px; }
  .net-chip { display: none; }
}
@media (max-width: 760px) {
  #app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) minmax(0, 0.9fr); grid-template-areas: "hud" "stage" "side"; gap: 8px; padding-left: 10px; padding-right: 10px; }
  .hud { gap: 8px 12px; }
  .brand { width: 100%; display: flex; align-items: baseline; justify-content: space-between; }
  h1 { font-size: 22px; }
  .num { font-size: 18px; }
  .num.sm { font-size: 15px; }
  .stat { min-width: 0; }
  .net-chip { display: none; }
  .claim { width: 100%; grid-template-columns: minmax(0, 1fr) auto; }
  .hint { display: none; }
  .view-btns { bottom: 8px; right: 8px; }
  .card-panel { left: 8px; bottom: 8px; padding: 10px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* RGB edition: animated rainbow tag and the extra buy row in the market */
.tag.rgb { color: #16191d; font-weight: 700; background: linear-gradient(90deg, #ef5b57, #f2a23a, #e8d44d, #6fbf8e, #86a9d6, #b48ce0, #ef5b57); background-size: 300% 100%; animation: rgbflow 3s linear infinite; }
@keyframes rgbflow { to { background-position: 300% 0; } }
.rgb-row { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px dashed var(--line); padding-top: 6px; margin-top: 2px; }
.rgb-row .meta { white-space: nowrap; }
.buy-inline { display: flex; align-items: center; gap: 8px; flex: none; }
@media (prefers-reduced-motion: reduce) { .tag.rgb { animation: none; } }

/* Rig swap: change every card of a rig to one model */
.rigswap { margin: -2px 0 6px; }
.rigswap summary { cursor: pointer; font-size: 12px; color: var(--accent); padding: 4px 2px; }
.swap-list { display: grid; gap: 6px; margin-top: 4px; }
.swap-row { background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 8px 10px; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; }
.swap-row .name { font-weight: 600; display: flex; align-items: center; gap: 6px; font-size: 13px; }
.swap-row .meta { grid-column: 1; font-family: var(--font-mono); font-size: 11px; color: var(--text-2); }
.swap-row button { grid-column: 2; grid-row: 1 / span 2; }

/* 404 page */
body.notfound { display: grid; place-items: center; min-height: 100dvh; }
.nf { text-align: center; padding: 24px; display: grid; gap: 10px; justify-items: center; }
.nf h1 { font-family: var(--font-head); font-size: 32px; }
.nf p { color: var(--text-2); }
.nf a { color: var(--accent); }

/* Bulk overclock */
.item.ocall { border-color: rgba(242, 162, 58, 0.5); }
.rig-tools { display: flex; gap: 6px; margin: 0 0 4px; }
.rig-tools button { font-size: 12px; min-height: 32px; padding: 0 10px; }

/* Daily event banner (over the 3D view, top left) */
.event-bar { position: absolute; top: 10px; left: 10px; max-width: min(360px, calc(100% - 20px)); display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center;
  background: rgba(22, 25, 29, 0.86); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; font-size: 12px; line-height: 1.4; color: var(--text-2); pointer-events: none; backdrop-filter: blur(4px); }
.event-bar b { color: var(--text); }
.event-bar.good { border-color: rgba(111, 191, 142, 0.6); }
.event-bar.bad { border-color: rgba(239, 91, 87, 0.6); }
.event-bar .ev-icon { font-size: 20px; width: 24px; text-align: center; }
.event-bar.good .ev-icon { color: var(--green); }
.event-bar.bad .ev-icon { color: var(--red); }
.event-bar .ev-next { grid-column: 1 / -1; font-family: var(--font-mono); font-size: 11px; border-top: 1px dashed var(--line); padding-top: 4px; margin-top: 2px; }

/* First-minute tips */
.coach { position: fixed; z-index: 50; width: min(290px, calc(100vw - 16px)); background: var(--surface); border: 1px solid var(--accent); border-radius: 6px;
  padding: 10px 12px; font-size: 13px; line-height: 1.45; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }
.coach p { margin: 0 0 8px; }
.coach-foot { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.coach-foot span { margin-right: auto; font-family: var(--font-mono); font-size: 11px; color: var(--text-2); }
.coach-foot button { min-height: 32px; padding: 0 10px; font-size: 12px; flex: none; }
.coach-target { outline: 2px solid var(--accent); outline-offset: 3px; animation: coachpulse 1.4s ease-in-out infinite; }
@keyframes coachpulse { 50% { outline-color: rgba(242, 162, 58, 0.25); } }
@media (prefers-reduced-motion: reduce) { .coach-target { animation: none; } }
@media (max-width: 900px) { .toast { top: auto; bottom: 12px; } }

/* Sound and music toggles */
.audio { display: grid; gap: 4px; margin-top: auto; }
.audio-row { display: grid; grid-template-columns: 40px 56px 1fr 48px; align-items: center; gap: 8px; }
.audio-row button { min-height: 34px; padding: 0; font-size: 15px; }
.audio-row button[aria-pressed="false"] { color: var(--text-2); }
.audio-row label { font-size: 12px; color: var(--text-2); }
.audio-row output { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }
.audio-row input[type=range] { width: 100%; min-width: 0; height: 28px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.audio-row input[type=range].off { accent-color: var(--line-strong); opacity: 0.6; }
.audio + .credit { margin-top: 0; }
.audio-row .gfx-ic { display: grid; place-items: center; min-height: 34px; color: var(--text-2); font-size: 15px; }
.audio-row select { min-height: 30px; min-width: 0; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 4px; font: inherit; font-size: 12px; padding: 0 6px; cursor: pointer; }

/* Gno.land link */
.btn-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 4px; border: 1px solid var(--line-strong); color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }

/* Season countdown (over the 3D view, top right): calm, then amber in the last 3 days, red in the last hour */
.season-clock { position: absolute; top: 10px; right: 10px; display: grid; justify-items: end; gap: 1px; background: rgba(22, 25, 29, 0.86); border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 10px; font-size: 12px; color: var(--text-2); pointer-events: none; backdrop-filter: blur(4px); text-align: right; }
.season-clock b { font-family: var(--font-mono); font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.season-clock .sub { font-size: 11px; }
.season-clock.soon { border-color: rgba(242, 162, 58, 0.7); }
.season-clock.soon b { color: var(--accent); }
.season-clock.last { border-color: rgba(239, 91, 87, 0.8); }
.season-clock.last b { color: var(--red); font-size: 15px; }
@media (max-width: 760px) { .event-bar { max-width: calc(100% - 150px); } .season-clock { font-size: 11px; padding: 5px 8px; } }

/* Badges in Facility, and the share-card dialog */
.item.badge-row { grid-template-columns: auto 1fr auto; }
.item.badge-row .meta { grid-column: auto; }
.item.badge-row .buy { grid-column: 3; grid-row: 1; }
.badge-txt { display: grid; gap: 2px; min-width: 0; }
.badge-ico { display: block; }
dialog.wide { max-width: min(760px, calc(100vw - 32px)); }
.share-card { display: block; width: 100%; height: auto; border-radius: 6px; margin-bottom: 12px; aspect-ratio: 1200 / 630; }
.card-dl { display: flex; gap: 8px; margin-bottom: 12px; }
.card-dl button { flex: 1; }
