/* =============================================
   SHARK TANK 8-BIT — Global Styles
   Canvas: 480×320 (3× NES resolution)
   Font: Press Start 2P (loaded via Google Fonts or local)
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

body {
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  overflow: hidden;
}

/* ── Game wrapper — scales to fill viewport, stays pixel-sharp ── */
#game-wrapper {
  position: relative;
  width: 480px;
  height: 320px;
  image-rendering: pixelated;
  /* JS writes --game-scale on load and resize */
  transform: scale(var(--game-scale, 1));
  transform-origin: center center;
}

#game-canvas {
  display: block;
  width: 480px;
  height: 320px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ── UI layer sits exactly over canvas ── */
#ui-layer {
  position: absolute;
  inset: 0;
  pointer-events: none; /* children opt-in individually */
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #e8e8c8;
}

/* ── Screen visibility ── */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
}
.screen.active  { pointer-events: all; }
.screen.hidden  { display: none; }

/* ── Pixel title ── */
.pixel-title {
  font-size: 16px;
  color: #e8b84b;
  text-shadow: 2px 2px 0 #7a5a00;
  letter-spacing: 2px;
  text-align: center;
}
.pixel-sub {
  font-size: 7px;
  color: #aaaaaa;
  text-align: center;
}

/* ── Business list ── */
#business-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 160px;
  overflow-y: auto;
  width: 380px;
}
.business-btn {
  background: #1a2a1a;
  border: 2px solid #3a5a3a;
  color: #c8e8c8;
  padding: 6px 10px;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  cursor: pointer;
  text-align: left;
  line-height: 1.6;
  transition: background .1s;
}
.business-btn:hover, .business-btn.selected {
  background: #2a4a2a;
  border-color: #5aaa5a;
  color: #ffffff;
}
.business-btn .biz-name { color: #e8b84b; }
.business-btn .biz-stats { color: #8ab88a; font-size: 6px; }

/* ── Pitch form ── */
#pitch-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 380px;
}
#pitch-form.hidden { display: none; }

.form-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.form-row label {
  width: 70px;
  color: #aaaaaa;
  font-size: 7px;
}
.form-row input {
  flex: 1;
  background: #0d1b0d;
  border: 2px solid #3a5a3a;
  color: #e8e8c8;
  padding: 4px 6px;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
}

#valuation-display {
  font-size: 7px;
  color: #e8b84b;
  text-align: center;
}

/* ── Pixel buttons ── */
.pixel-btn {
  background: #1a1a3a;
  border: 2px solid #5a5aaa;
  color: #c8c8ff;
  padding: 6px 14px;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  cursor: pointer;
  letter-spacing: 1px;
}
.pixel-btn:hover  { background: #2a2a5a; border-color: #8a8aff; }
.pixel-btn:active { transform: translate(1px, 1px); }
.pixel-btn.green  { background: #0a2a0a; border-color: #3aaa3a; color: #aaffaa; }
.pixel-btn.green:hover { background: #0d3a0d; }
.pixel-btn.red    { background: #2a0a0a; border-color: #aa3a3a; color: #ffaaaa; }
.pixel-btn.red:hover   { background: #3a0d0d; }

/* ── Dialogue box ── */
#dialogue-box {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  background: #0d1b0d;
  border: 3px solid #c8b89a;
  padding: 10px 12px 8px;
  min-height: 70px;
  pointer-events: all;
  cursor: pointer;
}
#dialogue-shark-name {
  font-size: 7px;
  color: #e8b84b;
  margin-bottom: 6px;
}
#dialogue-text {
  font-size: 7px;
  color: #e8e8c8;
  line-height: 1.8;
  min-height: 32px;
}
#dialogue-continue {
  font-size: 6px;
  color: #888888;
  text-align: right;
  margin-top: 4px;
  animation: blink 1s step-end infinite;
}

/* ── Offer panel ── */
#offer-panel {
  position: absolute;
  bottom: 94px;
  left: 50%;
  transform: translateX(-50%);
  background: #0d0d1b;
  border: 3px solid #e8b84b;
  padding: 10px 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: all;
  min-width: 260px;
  max-width: 420px;
}
#offer-panel.hidden { display: none; }

#offer-header {
  font-size: 7px;
  color: #e8b84b;
  text-align: center;
  letter-spacing: 1px;
}

/* Single-offer text (same as before for 1 shark) */
#offer-single-text {
  font-size: 7px;
  color: #e8e8c8;
  text-align: center;
  line-height: 1.8;
  padding: 4px 0;
}

/* Multi-offer cards */
#offer-cards {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

.offer-card {
  background: #1a1a2a;
  border: 2px solid #3a3a6a;
  color: #c8c8e8;
  padding: 4px 8px;
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  cursor: pointer;
  text-align: left;
  line-height: 1.7;
  transition: background .08s;
}
.offer-card:hover   { background: #22224a; border-color: #5a5aaa; }
.offer-card.selected {
  background: #1a2a1a;
  border-color: #5aaa5a;
  color: #aaffaa;
}

#offer-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 2px;
}

/* ── Result screen ── */
#result-card {
  background: #0d0d0d;
  border: 3px solid #e8b84b;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: all;
}
#result-headline {
  font-size: 14px;
  text-align: center;
}
#result-details {
  font-size: 7px;
  color: #aaaaaa;
  text-align: center;
  line-height: 2;
  white-space: pre-line;
}

/* ── HUD (rendered on canvas, but keep reference here) ── */
/* Deal meter, shark OUT indicators: drawn in canvas HUD layer */

/* ── Animations ── */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
