/* Aperture Mini App — citron on slate, the palette the bot's emoji tiles use
   (see scripts/generate_bot_emoji.py). Dark-first on purpose: the identity
   should survive a client set to the light theme, so nothing here reads
   prefers-color-scheme. */
:root {
  --ground: #0f1113;
  --card: #1e2226;
  --card-hi: #262b30;
  --keyline: rgba(168, 216, 31, 0.28);
  --hairline: rgba(255, 255, 255, 0.07);
  --accent: #cdff4a;
  --amber: #ffbe46;
  --red: #ff6060;
  --green: #4ade80;
  --text: #e7ecea;
  --dim: #8d9895;
  --radius: 16px;
  --bar-h: 66px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  padding: 14px 14px calc(var(--bar-h) + 22px);
  background: var(--ground);
  color: var(--text);
  font: 15px/1.45 -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  overflow-x: hidden;
}

.head { display: flex; align-items: baseline; gap: 9px; margin: 4px 2px 16px; }
.head h1 {
  margin: 0; font-size: 15px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}
.head .sub {
  color: var(--dim); font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Cards. A top light gradient plus a hairline keyline is what reads as a
   raised panel; a real drop shadow smears on an OLED phone. */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.card {
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 9px;
  min-height: 92px; padding: 18px 14px;
  border: 1px solid var(--keyline);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .065), rgba(255, 255, 255, 0) 62%),
    var(--card);
  color: var(--accent);
  cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}
.card:active { transform: scale(.98); background: var(--card-hi); }
.card .label { color: var(--text); font-size: 15px; font-weight: 600; }
.card .count {
  position: absolute; top: 10px; right: 13px;
  color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums;
}

/* The wide card breaks the two-column rhythm the way the reference does:
   icon left, label beside it, figure hard right. */
.card.wide {
  grid-column: span 2;
  flex-direction: row; justify-content: flex-start; gap: 12px;
  min-height: 68px; padding: 16px 18px;
}
.card.wide .count { position: static; margin-left: auto; font-size: 20px; color: var(--accent); }

.ic { flex: none; }

/* Feed rows */
.rows { display: flex; flex-direction: column; gap: 8px; }
.rows.spaced { margin-top: 14px; }
.row {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 14px;
  border: 1px solid var(--hairline);
  border-radius: 13px;
  background: var(--card);
  color: var(--dim);
  cursor: pointer;
  transition: background .12s ease;
}
.row:active { background: var(--card-hi); }
.row .chat {
  flex: 1; min-width: 0; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row .when { font-size: 12px; font-variant-numeric: tabular-nums; }
.row .num { font-variant-numeric: tabular-nums; color: var(--text); }
.row.win { border-color: var(--keyline); color: var(--accent); }
.row.static { cursor: default; }
.row.static:active { background: var(--card); }

.up { color: var(--green); }
.down { color: var(--red); }

/* Chips: filters and pagers */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.chip {
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--hairline);
  background: var(--card); color: var(--dim); font-size: 13px;
  transition: color .12s ease, border-color .12s ease;
}
.chip.on { border-color: var(--keyline); color: var(--accent); }
.chip:active { background: var(--card-hi); }

.note { color: var(--dim); padding: 30px 6px; text-align: center; }
.err { color: var(--red); padding: 30px 6px; text-align: center; line-height: 1.6; }

.text {
  padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--hairline); background: var(--card);
  color: var(--text); white-space: pre-wrap; word-break: break-word;
  max-height: 44vh; overflow-y: auto;
}

/* Bottom bar: fixed pills, the geometry of the reference screenshot. */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(15, 17, 19, .55), var(--ground) 45%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.pill {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 46px; border-radius: 14px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .08);
  background: linear-gradient(180deg, #34383c, #24282c);
  color: var(--dim); font-weight: 600; font-size: 14px;
  transition: transform .12s ease, color .12s ease;
}
.pill.on {
  color: var(--text);
  background: linear-gradient(180deg, #4c5157, #34383c);
  border-color: rgba(255, 255, 255, .14);
}
.pill:active { transform: scale(.985); }

/* Converter */
.conv { display: flex; gap: 8px; margin: 4px 0 2px; }
.conv input {
  min-width: 0; padding: 13px 14px; border-radius: 13px;
  border: 1px solid var(--hairline);
  background: var(--card); color: var(--text);
  font: inherit; font-size: 15px; font-variant-numeric: tabular-nums;
  text-align: center;
}
.conv .amt { flex: 2; text-align: left; }
.conv .code { flex: 1; text-transform: uppercase; letter-spacing: .05em; }
.conv input:focus { outline: none; border-color: var(--keyline); }

.out {
  margin-top: 10px; padding: 18px 16px; border-radius: var(--radius);
  border: 1px solid var(--keyline); background: var(--card);
  font-size: 17px; font-variant-numeric: tabular-nums; text-align: center;
}
.out .to { color: var(--accent); font-weight: 700; }
.out.muted { border-color: var(--hairline); color: var(--dim); font-size: 14px; }
