/* ========================================================================
   Claude Office: On-Chain — dark "developer tool" theme + Solana accents
   ======================================================================== */

:root {
  --bg: #0c0e13;
  --bg-2: #11141c;
  --panel: #161a24;
  --panel-2: #1b2030;
  --panel-3: #222838;
  --border: #2a3142;
  --border-2: #353d52;

  --text: #e7eaf2;
  --text-dim: #9aa3b8;
  --text-faint: #5e6884;

  --accent: #a78bfa; /* purple */
  --accent-2: #f0883e; /* claude orange */

  /* Solana brand gradient endpoints */
  --sol-purple: #9945ff;
  --sol-green: #14f195;

  --good: #14f195;
  --work: #ffb454;
  --bad: #ff5d6c;
  --info: #5db8ff;

  --mono: "SF Mono", "JetBrains Mono", "Fira Code", ui-monospace, Menlo,
    Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  overflow: hidden;
}

#app {
  display: grid;
  grid-template-columns: 318px 1fr 350px;
  grid-template-rows: 46px 1fr 30px;
  grid-template-areas:
    "header header header"
    "left   stage  right"
    "ticker ticker ticker";
  height: 100vh;
  width: 100vw;
  gap: 1px;
  background: var(--border);
}

/* ---------------- Header ---------------- */
#header {
  grid-area: header;
  background: linear-gradient(180deg, #14171f, #0e1118);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
}
.logo {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.logo .c {
  color: var(--accent-2);
}
.logo .o {
  color: var(--text);
}
.logo .chain {
  background: linear-gradient(90deg, var(--sol-purple), var(--sol-green));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
}
.header-spacer {
  flex: 1;
}
.hdr-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
  padding: 0 8px;
  border-left: 1px solid var(--border);
}
.hdr-stat .label {
  color: var(--text-faint);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.hdr-stat .val {
  font-size: 14px;
  font-weight: 700;
}
.sol {
  color: var(--sol-green);
}

/* ---------------- Buttons ---------------- */
button {
  font-family: var(--mono);
  cursor: pointer;
  border: 1px solid var(--border-2);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  transition:
    background 0.12s,
    border-color 0.12s,
    transform 0.05s;
}
button:hover:not(:disabled) {
  background: var(--panel-3);
  border-color: var(--accent);
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button.primary {
  border-color: transparent;
  background: linear-gradient(90deg, var(--sol-purple), #6f3fd6);
  color: #fff;
  font-weight: 600;
}
button.primary:hover:not(:disabled) {
  filter: brightness(1.12);
}
button.sol-btn {
  background: linear-gradient(90deg, var(--sol-purple), var(--sol-green));
  color: #06210f;
  font-weight: 700;
  border-color: transparent;
}
button.buy {
  border-color: #1c5a3a;
  color: var(--good);
}
button.sell {
  border-color: #5a2230;
  color: var(--bad);
}
button.tiny {
  padding: 3px 7px;
  font-size: 11px;
}

/* ---------------- Panels / columns ---------------- */
#left,
#right {
  background: var(--bg-2);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}
#left {
  grid-area: left;
}
#right {
  grid-area: right;
}

.panel {
  border-bottom: 1px solid var(--border);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 11px;
  background: var(--panel);
  color: var(--text-dim);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 2;
}
.panel-head .badge {
  background: var(--panel-3);
  color: var(--text-dim);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 10px;
}
.panel-body {
  padding: 9px 11px;
}

/* generic key/value row */
.kv {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  color: var(--text-dim);
}
.kv .v {
  color: var(--text);
  font-weight: 600;
}

/* ---------------- Stage / canvas ---------------- */
#stage {
  grid-area: stage;
  background:
    radial-gradient(1200px 800px at 50% 0%, #14171f 0%, #0a0c11 75%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
#game-canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 0 0 1px var(--border), 0 18px 60px rgba(0, 0, 0, 0.6);
  border-radius: 4px;
}
#stage-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* floating toast / payout pops */
.toast-layer {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  z-index: 30;
}
.toast {
  background: rgba(20, 24, 34, 0.94);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 7px 13px;
  font-size: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.25s ease;
}
.toast.good {
  border-color: #1c5a3a;
}
.toast.bad {
  border-color: #5a2230;
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* ---------------- Market chart ---------------- */
.chart-wrap {
  background: #0c0f16;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px;
}
canvas.spark {
  display: block;
  width: 100%;
  height: 64px;
}

/* ---------------- Lists (jobs, employees, log) ---------------- */
.list {
  display: flex;
  flex-direction: column;
}
.row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.row .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.row .grow {
  flex: 1;
  min-width: 0;
}
.row .name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row .sub {
  color: var(--text-faint);
  font-size: 11px;
}
.row .amt {
  font-weight: 700;
}

.bar {
  height: 5px;
  border-radius: 3px;
  background: var(--panel-3);
  overflow: hidden;
  margin-top: 3px;
}
.bar > i {
  display: block;
  height: 100%;
  background: var(--accent);
}

/* event log */
#log {
  font-size: 11px;
  line-height: 1.5;
}
.logline {
  padding: 2px 11px;
  color: var(--text-dim);
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.logline .t {
  color: var(--text-faint);
}
.logline.good {
  color: var(--good);
}
.logline.bad {
  color: var(--bad);
}
.logline.work {
  color: var(--work);
}
.logline.chain {
  color: var(--sol-green);
}

/* ---------------- Ticker ---------------- */
#ticker {
  grid-area: ticker;
  background: #0a0c11;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  overflow: hidden;
  font-size: 12px;
  color: var(--text-dim);
}
#ticker .scroll {
  white-space: nowrap;
  will-change: transform;
  padding-left: 100%;
}
#ticker .tk {
  margin: 0 22px;
}
#ticker .up {
  color: var(--good);
}
#ticker .down {
  color: var(--bad);
}

/* ---------------- Wallet pill ---------------- */
.wallet-box {
  padding: 9px 11px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
}
.pill .live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sol-green);
  box-shadow: 0 0 6px var(--sol-green);
}
.real-tag {
  font-size: 9px;
  color: var(--sol-green);
  border: 1px solid #1c5a3a;
  border-radius: 4px;
  padding: 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sim-tag {
  font-size: 9px;
  color: var(--text-faint);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.muted {
  color: var(--text-faint);
}
.note {
  font-size: 10px;
  color: var(--text-faint);
  line-height: 1.4;
  margin-top: 6px;
}
.btn-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
hr.sep {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 9px 0;
}

/* scrollbars */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-thumb {
  background: var(--panel-3);
  border-radius: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* flashes */
@keyframes flashGood {
  0% {
    background: rgba(20, 241, 149, 0.18);
  }
  100% {
    background: transparent;
  }
}
.flash-good {
  animation: flashGood 0.6s ease;
}

/* ---------------- Top nav ---------------- */
.topnav {
  display: flex;
  gap: 4px;
  margin-left: 14px;
}
.topnav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid transparent;
}
.topnav a:hover {
  color: var(--text);
  background: var(--panel-2);
}
.topnav a.active {
  color: var(--sol-green);
  border-color: var(--border-2);
  background: var(--panel-2);
}
.btn-link {
  display: inline-block;
  text-decoration: none;
  text-align: center;
  font-family: var(--mono);
  border: 1px solid var(--border-2);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  flex: 1;
}
.btn-link:hover {
  border-color: var(--accent);
  background: var(--panel-3);
}

/* ---------------- Energy / ⚡ ---------------- */
.energy {
  color: #ffd23f;
}
button.buy.buynrg,
.buynrg {
  border-color: #6b5a17;
  color: #ffd23f;
}

/* ---------------- Workshop store ---------------- */
.convert-box {
  background: #0c0f16;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 9px;
  margin: 8px 0;
}
.store-sub {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-dim);
  font-weight: 700;
  margin: 10px 0 5px;
}
.store-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.store-row .ico {
  font-size: 18px;
  flex: 0 0 auto;
  width: 22px;
  text-align: center;
}
.store-row .grow {
  flex: 1;
  min-width: 0;
}
.store-row .name {
  font-weight: 600;
  font-size: 12px;
}
.store-row .name .sub {
  color: var(--sol-green);
  font-weight: 600;
}
.store-row .sub {
  color: var(--text-faint);
  font-size: 10px;
  line-height: 1.3;
}
.store-row.owned {
  opacity: 0.62;
}
.store-row button {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* ---------------- Achievements ---------------- */
.achv-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 11px 5px;
  font-size: 12px;
  color: var(--text-dim);
}
.tier-chip {
  border: 1px solid var(--tc, var(--border-2));
  color: var(--tc, var(--text));
  border-radius: 20px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 700;
  background: color-mix(in srgb, var(--tc, #000) 12%, transparent);
}
.achv-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.achv-row .ico {
  font-size: 17px;
  flex: 0 0 auto;
  width: 22px;
  text-align: center;
}
.achv-row .grow {
  flex: 1;
  min-width: 0;
}
.achv-row .name {
  font-weight: 600;
  font-size: 12px;
}
.achv-row .name .pts {
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}
.achv-row .sub {
  color: var(--text-faint);
  font-size: 10px;
}
.achv-row .time {
  font-size: 11px;
  font-weight: 700;
  color: var(--sol-green);
  flex: 0 0 auto;
}
.achv-row.locked {
  opacity: 0.5;
}
.achv-row.done {
  background: linear-gradient(90deg, rgba(20, 241, 149, 0.05), transparent);
}
