:root {
  --egg-cream: #f3ece0;
  --egg-shadow: #c8b498;
  --egg-speck: #8a6a4a;
  --egg-band: #b91c1c;
  --gold: #c9a227;
  --gold-bright: #f0d060;
  --lcd: #08140c;
  --phosphor: #9dff7a;
  --phosphor-dim: #4a8f3a;
  --amber: #e8c36a;
  --warn: #ff6b3d;
  --shop-black: #090a0c;
  --btn-a: #e8a0b8;
  --btn-b: #f0d878;
  --btn-c: #8fd4a0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  background: var(--shop-black);
  color: #d7d2c6;
  font-family: "Share Tech Mono", ui-monospace, monospace;
}

button, input { font-family: inherit; }

.workshop {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  padding: 12px 12px 18px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 220, 180, 0.1), transparent 42%),
    radial-gradient(ellipse at 80% 90%, rgba(60, 90, 60, 0.15), transparent 40%),
    linear-gradient(180deg, #14161b 0%, #0b0c0f 48%, #1a1714 100%);
  overflow: hidden;
  position: relative;
}

.bay-lights {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(900px, 100%);
  height: 90px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 214, 130, 0.18), transparent 70%);
  pointer-events: none;
}

.floor-stain {
  position: absolute;
  bottom: 8%;
  width: 70%;
  height: 80px;
  background: radial-gradient(ellipse, rgba(20, 12, 6, 0.55), transparent 70%);
  pointer-events: none;
}

.sparks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.spark {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #ffe9a0;
  box-shadow: 0 0 8px #ffb347;
  border-radius: 50%;
  animation: spark-fall 900ms linear forwards;
}

@keyframes spark-fall {
  to {
    transform: translate(var(--dx), var(--dy)) scale(0.2);
    opacity: 0;
  }
}

.overhead {
  text-align: center;
  z-index: 2;
  letter-spacing: 0.22em;
  margin-bottom: 6px;
}

.overhead-tag {
  font-family: "Black Ops One", Impact, sans-serif;
  letter-spacing: 0.14em;
  font-size: clamp(14px, 2.4vw, 22px);
  color: #f3ead2;
  text-shadow: 0 2px 0 #000, 0 0 18px rgba(255, 180, 60, 0.25);
}

.overhead-sub {
  font-size: 11px;
  opacity: 0.62;
  margin-top: 4px;
  letter-spacing: 0.18em;
}

/* ── Tamagotchi egg shell ── */

.tama-stage {
  width: min(440px, 100%);
  display: grid;
  place-items: center;
  z-index: 3;
}

.tama {
  width: 100%;
  position: relative;
  filter: drop-shadow(0 24px 28px rgba(0, 0, 0, 0.55));
}

.keychain {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.keychain-ring {
  width: 28px;
  height: 28px;
  border: 4px solid #aaa;
  border-radius: 50%;
  background: transparent;
  box-shadow:
    inset 0 0 4px rgba(0,0,0,0.3),
    0 2px 0 #666;
}

.keychain-tab {
  width: 14px;
  height: 14px;
  margin-top: -2px;
  background: linear-gradient(180deg, #ccc, #888);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 2px 0 #555;
}

.tama-shell {
  position: relative;
  padding: 52px 22px 28px;
  background:
    radial-gradient(ellipse at 28% 18%, rgba(255,255,255,0.55) 0%, transparent 28%),
    radial-gradient(ellipse at 72% 35%, rgba(255,255,255,0.2) 0%, transparent 22%),
    linear-gradient(175deg, #faf6ee 0%, var(--egg-cream) 35%, #e8dcc8 70%, #d4c4a8 100%);
  border-radius: 50% 50% 48% 48% / 42% 42% 58% 58%;
  border: 3px solid #b8a888;
  box-shadow:
    inset 0 -20px 30px rgba(120, 90, 60, 0.15),
    inset 0 12px 20px rgba(255,255,255,0.4),
    0 0 0 2px #9a8870;
}

.shell-speckles {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image:
    radial-gradient(circle at 18% 25%, var(--egg-speck) 0 1.5px, transparent 2px),
    radial-gradient(circle at 35% 15%, var(--egg-speck) 0 1px, transparent 1.5px),
    radial-gradient(circle at 62% 20%, var(--egg-speck) 0 1.2px, transparent 1.8px),
    radial-gradient(circle at 78% 32%, var(--egg-speck) 0 1px, transparent 1.5px),
    radial-gradient(circle at 22% 55%, var(--egg-speck) 0 1px, transparent 1.5px),
    radial-gradient(circle at 48% 48%, var(--egg-speck) 0 1.3px, transparent 2px),
    radial-gradient(circle at 70% 58%, var(--egg-speck) 0 1px, transparent 1.5px),
    radial-gradient(circle at 85% 70%, var(--egg-speck) 0 1.2px, transparent 1.8px),
    radial-gradient(circle at 30% 78%, var(--egg-speck) 0 1px, transparent 1.5px),
    radial-gradient(circle at 55% 85%, var(--egg-speck) 0 1.5px, transparent 2px);
  opacity: 0.45;
  pointer-events: none;
}

.shell-shine {
  position: absolute;
  top: 8%;
  left: 12%;
  width: 35%;
  height: 22%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.5), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.brand-plate {
  position: absolute;
  top: 14%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  background: var(--egg-band);
  color: #fff;
  padding: 4px 14px 5px;
  border-radius: 4px;
  box-shadow: 0 3px 0 #7a1212, inset 0 1px 0 rgba(255,255,255,0.2);
  z-index: 2;
  white-space: nowrap;
}

.brand-name {
  display: block;
  font-family: "Black Ops One", sans-serif;
  font-size: 13px;
  letter-spacing: 0.12em;
  line-height: 1.1;
}

.brand-sub {
  display: block;
  font-size: 7px;
  letter-spacing: 0.18em;
  opacity: 0.85;
}

.shell-stickers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
.shell-stickers .sticker { pointer-events: auto; }

.sticker {
  position: absolute;
  border: none;
  cursor: pointer;
  font-size: 9px;
  padding: 3px 6px;
  border-radius: 3px;
  box-shadow: 1px 2px 0 rgba(0,0,0,0.35);
  transition: transform 120ms ease;
}
.sticker:hover { transform: scale(1.08) rotate(var(--rot, 0deg)); }

.s-goose {
  bottom: 22%;
  left: 8%;
  background: #fff;
  font-size: 14px;
  padding: 2px 5px;
  transform: rotate(-8deg);
  --rot: -8deg;
}

/* ── LCD screen (classic tama placement) ── */

.screen-bezel {
  position: relative;
  background: #2a2a2a;
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.5),
    0 4px 0 #1a1a1a;
  margin-bottom: 14px;
}

.screen-window {
  position: relative;
  min-height: 300px;
  aspect-ratio: 4 / 5;
  background: var(--lcd);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 0 24px rgba(0,0,0,0.6);
  border: 2px solid #111;
}

.lcd-tint {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  transition: background 220ms ease;
}
.tama[data-theme="day"] .lcd-tint { background: rgba(8, 40, 18, 0.1); }
.tama[data-theme="grind"] .lcd-tint { background: rgba(4, 28, 12, 0.45); }
.tama[data-theme="night"] .lcd-tint { background: rgba(2, 8, 20, 0.72); }

.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0.1) 0 1px, transparent 1px 3px);
  pointer-events: none;
  z-index: 7;
  opacity: 0.15;
}

.screen-glare {
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, rgba(255,255,255,0.06) 0 15%, transparent 30%);
  pointer-events: none;
  z-index: 9;
}

/* ── Classic A / B / C buttons ── */

.tama-buttons {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 10px;
}

.tama-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid rgba(0,0,0,0.25);
  font-family: "Press Start 2P", monospace;
  font-size: 14px;
  cursor: pointer;
  box-shadow:
    0 5px 0 rgba(0,0,0,0.35),
    inset 0 2px 4px rgba(255,255,255,0.35);
  transition: transform 80ms ease, box-shadow 80ms ease;
}
.tama-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.35), inset 0 2px 4px rgba(255,255,255,0.35);
}

.btn-a { background: var(--btn-a); color: #5a2040; }
.btn-b { background: var(--btn-b); color: #5a4810; }
.btn-c { background: var(--btn-c); color: #1a4a28; }

.serial {
  text-align: center;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--egg-speck);
  cursor: pointer;
  opacity: 0.7;
}

/* Action pad below screen, outside LCD */
.pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.pad button {
  background: #2a2a2a;
  color: #e8e4dc;
  border: 1px solid #555;
  padding: 9px 4px;
  font-family: "Share Tech Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  border-radius: 4px;
  box-shadow: 0 3px 0 #1a1a1a;
}
.pad button:hover { background: #3a3a3a; }
.pad button:active { transform: translateY(2px); box-shadow: none; }
.pad.hidden { display: none; }

.bench {
  z-index: 4;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
}
.bench button,
.bench span {
  background: #1b1e24;
  border: 1px solid #3a3f48;
  color: #cfc6b4;
  padding: 7px 10px;
  font-size: 11px;
  letter-spacing: 0.1em;
  cursor: pointer;
}
.bench span { cursor: default; opacity: 0.8; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #111;
  color: var(--amber);
  border: 1px solid var(--gold);
  padding: 10px 14px;
  z-index: 20;
  max-width: min(520px, 92vw);
  font-size: 13px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

@media (max-width: 400px) {
  .tama-shell { padding: 48px 16px 24px; }
  .tama-btn { width: 46px; height: 46px; font-size: 12px; }
  .brand-name { font-size: 11px; }
}
