/* Kirator Arcade — shell styles on Construct Control Room tokens */

:root {
  --radius: 10px;
  --font: 'DM Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body.arcade-locked { overflow: hidden; }

.kira-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(20px + var(--safe-top)) 28px calc(20px + var(--safe-bottom));
  max-width: 1280px;
  margin: 0 auto;
}

/* ---- Boot ---- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 500px at 50% 40%, rgba(76, 116, 82, 0.22), transparent 60%),
    #0E1911;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}
.boot.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.boot-inner {
  text-align: center;
  width: min(420px, 88vw);
}
.boot-logo {
  width: 160px;
  height: 160px;
  object-fit: contain;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 8px;
  box-shadow: 0 0 40px rgba(150, 218, 157, 0.18);
  animation: bootPulse 1.6s ease-in-out infinite;
}
.boot-title {
  margin: 22px 0 6px;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--bright);
}
.boot-line {
  margin: 0 0 18px;
  font-size: 0.92rem;
  color: var(--dim);
}
.boot-bar {
  height: 4px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}
.boot-bar > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--green), var(--bright));
  box-shadow: 0 0 16px var(--glow);
  transition: width 0.15s linear;
}
@keyframes bootPulse {
  0%, 100% { box-shadow: 0 0 28px rgba(150, 218, 157, 0.12); transform: scale(1); }
  50% { box-shadow: 0 0 48px rgba(150, 218, 157, 0.28); transform: scale(1.02); }
}

/* ---- Header ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  animation: riseIn 0.7s ease both;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.brand-lockup img {
  width: 108px;
  height: 108px;
  object-fit: contain;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 5px;
  box-shadow: 0 0 28px rgba(150, 218, 157, 0.14);
  flex-shrink: 0;
}
.brand-copy { min-width: 0; }
.brand-copy h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.15;
}
.brand-copy p {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}
.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(19, 30, 22, 0.85);
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mid);
  box-shadow: 0 0 10px var(--glow);
}
.pill[data-tone="ok"] .dot { background: var(--ok); }
.pill[data-tone="warn"] .dot { background: var(--warn); box-shadow: 0 0 10px rgba(212, 168, 75, 0.45); }
.pill[data-tone="bad"] .dot { background: var(--bad); box-shadow: none; }
.pill strong { color: var(--text); font-weight: 500; }

/* ---- Hero ---- */
.hero {
  margin-bottom: 22px;
  animation: riseIn 0.75s ease 0.08s both;
}
.hero h2 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--bright);
  text-shadow: 0 0 40px rgba(150, 218, 157, 0.18);
}
.hero p {
  margin: 0;
  max-width: 46ch;
  color: var(--dim);
  font-size: 1.02rem;
  line-height: 1.55;
}

/* ---- Layout ---- */
.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  flex: 1;
  align-items: start;
  animation: riseIn 0.8s ease 0.14s both;
}
@media (max-width: 920px) {
  .kira-shell { padding: calc(14px + var(--safe-top)) 14px calc(14px + var(--safe-bottom)); }
  .topbar { flex-direction: column; align-items: flex-start; }
  .status-row { justify-content: flex-start; flex-wrap: wrap; }
  .main-grid { grid-template-columns: 1fr; }
  .brand-lockup img { width: 72px; height: 72px; }
  .library { grid-template-columns: 1fr; }
  .game-tile { min-height: 220px; }
  .hero h2 { font-size: clamp(1.35rem, 6vw, 2rem); }
}
@media (orientation: portrait) and (max-width: 900px) {
  .kira-shell { min-height: 100dvh; }
  .rail { display: grid; gap: 12px; }
}

.section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section-label h3 {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mid);
}
.section-label span {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--dim);
  letter-spacing: 0.08em;
}

/* ---- Game tiles ---- */
.library {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.game-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(165deg, rgba(26, 41, 30, 0.96), rgba(19, 30, 22, 0.98));
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.game-tile:hover,
.game-tile:focus-visible {
  outline: none;
  border-color: var(--green);
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35), 0 0 28px var(--glow);
}
.game-tile:disabled {
  cursor: default;
  opacity: 0.72;
}
.game-tile:disabled:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border);
}

.game-art {
  position: relative;
  height: 148px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.game-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 40%, rgba(14, 25, 17, 0.92) 100%),
    repeating-linear-gradient(0deg, rgba(0,0,0,0.06) 0 1px, transparent 1px 3px);
  pointer-events: none;
}
.game-art-bg {
  position: absolute;
  inset: 0;
}
.game-art-bg.btc {
  background:
    radial-gradient(circle at 70% 30%, rgba(247, 147, 26, 0.35), transparent 45%),
    radial-gradient(circle at 20% 80%, rgba(150, 218, 157, 0.15), transparent 40%),
    linear-gradient(135deg, #122018, #1a291e 50%, #0e1911);
}
.game-art-bg.missile {
  background:
    radial-gradient(circle at 50% 20%, rgba(150, 218, 157, 0.28), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(76, 116, 82, 0.35), transparent 45%),
    linear-gradient(160deg, #0a1410, #131e16 55%, #1a291e);
}
.game-art-bg.satoshi {
  background:
    radial-gradient(circle at 65% 35%, rgba(247, 147, 26, 0.42), transparent 42%),
    radial-gradient(circle at 25% 70%, rgba(150, 218, 157, 0.18), transparent 45%),
    linear-gradient(145deg, #0a100c, #121a14 50%, #1a160e);
}
.game-art-bg.speedchain {
  background:
    radial-gradient(circle at 50% 50%, rgba(247, 147, 26, 0.28), transparent 40%),
    radial-gradient(circle at 20% 20%, rgba(150, 218, 157, 0.22), transparent 45%),
    linear-gradient(135deg, #101a13, #1a291e 45%, #1a140c);
}
.game-art-bg.soon {
  background:
    radial-gradient(circle at 40% 40%, rgba(76, 116, 82, 0.2), transparent 50%),
    linear-gradient(145deg, #101a13, #131e16);
}
.game-art-mark {
  position: absolute;
  left: 18px;
  bottom: 14px;
  z-index: 1;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bright);
  text-shadow: 0 0 12px var(--glow);
}
.game-art-key {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(14, 25, 17, 0.75);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--mid);
}

.game-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px 18px;
  flex: 1;
}
.game-body h4 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
}
.game-body p {
  margin: 0;
  color: var(--dim);
  font-size: 0.9rem;
  line-height: 1.45;
  flex: 1;
}
.game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.tag {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--dim);
  background: rgba(14, 25, 17, 0.55);
}
.tag.accent {
  color: var(--bright);
  border-color: rgba(76, 116, 82, 0.65);
  background: rgba(76, 116, 82, 0.18);
}
.game-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.game-actions .kira-btn {
  flex: 1;
}
.fav-btn {
  flex: 0 0 auto !important;
  width: 42px;
  padding-left: 0;
  padding-right: 0;
}
.fav-btn.is-on {
  color: var(--warn);
  border-color: rgba(212, 168, 75, 0.55);
}

/* ---- Side rail ---- */
.rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rail .kira-panel h4 {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mid);
}
.stat-list {
  display: grid;
  gap: 10px;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
}
.stat-row span { color: var(--dim); }
.stat-row strong {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--text);
  text-align: right;
}
.ticker {
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.55;
  color: var(--dim);
  min-height: 4.8em;
}
.ticker b { color: var(--bright); font-weight: 500; }
.help-keys {
  display: grid;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--dim);
}
.help-keys div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.kbd {
  color: var(--bright);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 5px;
  padding: 2px 7px;
  letter-spacing: 0.06em;
}

.footer {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  animation: riseIn 0.85s ease 0.2s both;
}
.footer a {
  color: var(--mid);
  text-decoration: none;
}
.footer a:hover { color: var(--bright); }

/* ---- Play overlay ---- */
.play-shell {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  flex-direction: column;
  background: #050a07;
}
.play-shell.is-open { display: flex; }
.play-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #131e16, #0e1911);
  border-bottom: 1px solid var(--border);
}
.play-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.play-bar-left img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 1px solid rgba(247, 147, 26, 0.35);
  background: var(--panel);
  padding: 4px;
  box-shadow: 0 0 18px rgba(247, 147, 26, 0.22);
}
.play-bar-left strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text);
}
.play-bar-left span {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}
.play-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.play-frame-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #000;
}
.play-frame-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .boot-logo,
  .topbar,
  .hero,
  .main-grid,
  .footer { animation: none !important; }
  .game-tile { transition: none; }
}
