/* THE 9-TO-5 — Office Life Simulator
 * MiniMax M3 build. Single static artifact, no build step. */

:root {
  --bg: #1a1612;
  --panel: rgba(28, 22, 17, 0.78);
  --panel-border: rgba(245, 230, 200, 0.12);
  --ink: #f3e6cb;
  --ink-soft: #c9b896;
  --ink-dim: #8a7a5c;
  --accent: #d59c4a;
  --danger: #d05656;
  --warn: #e0b340;
  --ok: #7aa860;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  --font: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(213, 156, 74, 0.06), transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(120, 90, 50, 0.08), transparent 60%),
    var(--bg);
}

.app {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
}

/* ---------- Stage ---------- */

.stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.office {
  width: 100%;
  height: 100%;
  display: block;
  background: #18130e;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.6));
}

/* Layered highlights for the office */
.office .floor {
  transition: fill 0.4s ease;
}

.office .wall {
  fill: #2c241c;
}

.office .wall-edge {
  fill: none;
  stroke: #1a1410;
  stroke-width: 1;
}

.office .desk {
  fill: #b88346;
  stroke: #6e4a25;
  stroke-width: 0.6;
}

.office .desk-dark {
  fill: #3a2f24;
  stroke: #1f1813;
  stroke-width: 0.6;
}

.office .chair {
  fill: #2a221b;
  stroke: #14100c;
  stroke-width: 0.4;
}

.office .monitor {
  fill: #18130f;
  stroke: #4a3a28;
  stroke-width: 0.5;
}

.office .monitor-glow {
  fill: #6aa0c8;
  opacity: 0.45;
}

.office .whiteboard {
  fill: #f6efe0;
  stroke: #8a7a5c;
  stroke-width: 0.8;
}

.office .plant {
  fill: #5a7a4a;
}

.office .plant-pot {
  fill: #6e4a25;
}

.office .coffee-machine {
  fill: #3a342e;
  stroke: #1a1410;
}

.office .coffee-light {
  fill: #e0b340;
  opacity: 0.7;
}

.office .printer {
  fill: #2a2520;
  stroke: #14100c;
}

.office .printer-light {
  fill: #d05959;
  opacity: 0;
}

.office .printer-light.active {
  opacity: 0.9;
  animation: pulseFlash 0.6s ease-in-out infinite alternate;
}

.office .table {
  fill: #b88346;
  stroke: #6e4a25;
  stroke-width: 0.6;
}

.office .fridge {
  fill: #d8d4cc;
  stroke: #888070;
}

.office .shelf {
  fill: #6e4a25;
  stroke: #3a2a18;
}

.office .box {
  fill: #c89860;
  stroke: #6e4a25;
}

.office .phone {
  fill: #2a221b;
}

.office .deal-board {
  fill: #f6efe0;
  stroke: #8a7a5c;
}

.office .zone-label {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 1.4px;
  fill: #8a7a5c;
  text-transform: uppercase;
  pointer-events: none;
}

.office .door {
  fill: #1a1410;
}

/* ---------- Characters ---------- */

.character {
  pointer-events: none;
}

.character .char-shadow {
  fill: rgba(0, 0, 0, 0.32);
}

.character .char-body {
  stroke: rgba(0, 0, 0, 0.35);
  stroke-width: 0.4;
}

.character .char-head {
  stroke: rgba(0, 0, 0, 0.35);
  stroke-width: 0.4;
}

.character .char-hands {
  stroke: rgba(0, 0, 0, 0.25);
  stroke-width: 0.3;
}

.character .char-eyes {
  fill: #1a1410;
}

.character .char-badge {
  fill: #f6efe0;
  font-family: var(--mono);
  font-size: 3.2px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
}

.character.urgent {
  animation: urgentPulse 0.8s ease-in-out infinite;
}

.character.celebrate .char-body,
.character.celebrate .char-head {
  animation: celebrateBounce 0.4s ease-in-out infinite;
}

@keyframes walkBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1px); }
}

.character.walking .char-shadow {
  animation: walkShadow 0.5s ease-in-out infinite;
}

@keyframes walkShadow {
  0%, 100% { transform: scaleX(1); }
  50% { transform: scaleX(1.1); }
}

.character.typing .char-head {
  animation: typingBob 0.35s ease-in-out infinite;
}

@keyframes typingBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(0.4px); }
}

.character.talking .char-body {
  transform-origin: center;
  animation: talkPulse 0.6s ease-in-out infinite;
}

@keyframes talkPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.character.eating .char-body {
  animation: eatNod 1.2s ease-in-out infinite;
}

@keyframes eatNod {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(0, 0.6px); }
}

.character.waiting .char-body {
  transform-origin: center;
  animation: waitSway 2.4s ease-in-out infinite;
}

@keyframes waitSway {
  0%, 100% { transform: rotate(-1.2deg); }
  50% { transform: rotate(1.2deg); }
}

.character.urgent {
  animation: urgentPulse 0.9s ease-in-out infinite;
}

@keyframes urgentPulse {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(208, 86, 86, 0)); }
  50% { filter: drop-shadow(0 0 4px rgba(208, 86, 86, 0.9)); }
}

@keyframes celebrateBounce {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.15) translateY(-2px); }
}

@keyframes pulseFlash {
  0% { opacity: 0.3; }
  100% { opacity: 0.95; }
}

/* Speech bubble */
.speech-bubble {
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.speech-bubble.visible {
  opacity: 1;
}

.speech-bubble .bubble-bg {
  fill: #f6efe0;
  stroke: #6e4a25;
  stroke-width: 0.6;
}

.speech-bubble .bubble-text {
  font-family: var(--mono);
  font-size: 4px;
  fill: #2c241c;
  text-anchor: middle;
  dominant-baseline: middle;
  font-weight: 700;
}

/* ---------- HUD ---------- */

.hud {
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.6px;
  color: var(--ink-soft);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
  min-width: 180px;
}

.hud-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.hud-label {
  text-transform: uppercase;
  color: var(--ink-dim);
  font-size: 9px;
  letter-spacing: 1.4px;
}

.hud-value {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.hud-value.fps { color: var(--ok); }
.hud-value.tasks { color: var(--accent); }
.hud-value.time { color: var(--ink); font-size: 13px; }

/* ---------- Title ---------- */

.title {
  position: absolute;
  top: 18px;
  left: 18px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
  max-width: 340px;
}

.title-main {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 700;
}

.title-sub {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 2px;
  letter-spacing: 0.2px;
}

.title-meta {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1.2px;
  color: var(--ink-dim);
  margin-top: 6px;
  text-transform: uppercase;
}

/* ---------- Day-end banner ---------- */

.banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  padding: 24px 36px;
  background: rgba(28, 22, 17, 0.92);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent);
  text-align: center;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  box-shadow: 0 0 60px rgba(213, 156, 74, 0.2), var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  z-index: 10;
}

.banner.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.banner-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.banner-stats {
  font-size: 12px;
  color: var(--ink);
  letter-spacing: 1px;
  margin-top: 6px;
}

.banner-stats span {
  color: var(--accent);
  font-weight: 700;
}

/* ---------- Bottom bar ---------- */

.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 24px;
  background: linear-gradient(to top, rgba(28, 22, 17, 0.95), rgba(28, 22, 17, 0.78));
  border-top: 1px solid var(--panel-border);
}

.btn {
  background: rgba(213, 156, 74, 0.08);
  border: 1px solid rgba(213, 156, 74, 0.35);
  color: var(--accent);
  padding: 10px 18px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  font-weight: 700;
}

.btn:hover {
  background: rgba(213, 156, 74, 0.18);
  border-color: rgba(213, 156, 74, 0.65);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn .btn-key {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  border: 1px solid rgba(245, 230, 200, 0.18);
  border-radius: 3px;
  font-size: 9px;
  color: var(--ink-soft);
}

.help {
  position: absolute;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--ink-dim);
  text-transform: uppercase;
  pointer-events: none;
}

.help span { color: var(--ink-soft); font-weight: 700; }

.legend {
  position: absolute;
  bottom: 76px;
  left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.6px;
  color: var(--ink-soft);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.legend-title {
  font-size: 8px;
  letter-spacing: 1.4px;
  color: var(--ink-dim);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

/* ---------- Paused indicator ---------- */

.paused-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 6, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 5;
}

.paused-overlay.visible {
  opacity: 1;
}

.paused-label {
  font-family: var(--mono);
  font-size: 24px;
  letter-spacing: 6px;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 700;
  padding: 18px 36px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: rgba(28, 22, 17, 0.85);
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .character.walking .char-shadow,
  .character.typing .char-head,
  .character.talking .char-body,
  .character.eating .char-body,
  .character.waiting .char-body,
  .character.urgent,
  .character.celebrate .char-body,
  .character.celebrate .char-head,
  .office .printer-light.active {
    animation: none !important;
  }
}
