:root {
  --bg: #f5f1e8;
  --ink: #2b2b2b;
  --blue: #002fa7;
  --yellow: #ffd400;
  --muted: #8a8578;
  --glow: #7ee787;
  --clock-accent: #ffffff;
}

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

body {
  font-family: 'Courier New', ui-monospace, monospace;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
  height: 100vh;
}
.scene {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  z-index: 1;
}

.scene.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}
.terminal {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 32px 40px;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  min-width: 360px;
  position: relative;
}

.terminal .line {
  margin-bottom: 16px;
  font-size: 15px;
}

.terminal .riddle {
  color: #e5c07b;
  font-size: 14px;
  margin: 12px 0 8px;
  line-height: 1.7;
  border-left: 3px solid #555;
  padding-left: 14px;
}

.terminal .riddle em {
  color: #c9a0ff;
  font-style: normal;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.prompt {
  color: var(--yellow);
  font-weight: bold;
}

#code-input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: inherit;
  font-size: 18px;
  width: 180px;
  border-bottom: 1px solid #555;
  letter-spacing: 2px;
}

#code-input::placeholder {
  color: #555;
  letter-spacing: 0;
}

.hint {
  color: #e06c75;
  font-size: 13px;
  margin-top: 16px;
  min-height: 20px;
}
#scene-fish {
  background: #000;
}
.clock-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  opacity: 1;
  transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.7, 0, 0.3, 1);
  pointer-events: auto;
  cursor: pointer;
}

.clock-overlay.hide {
  opacity: 0;
  pointer-events: none;
}

.clock-overlay.tunnel {
  transform: scale(6);
  opacity: 0;
  transition: transform 1s cubic-bezier(0.55, 0.085, 0.68, 0.53), opacity 0.8s ease-in;
  pointer-events: none;
}
.clock-ring {
  width: min(75vmin, 560px);
  height: min(75vmin, 560px);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 80px rgba(255, 255, 255, 0.1), inset 0 0 60px rgba(255, 255, 255, 0.03);
  animation: ringPulse 4s ease-in-out infinite;
}

.clock-ring::before {
  content: '';
  position: absolute;
  inset: -24px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  animation: ringSpin 24s linear infinite;
}

.clock-ring::after {
  content: '';
  position: absolute;
  inset: -48px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.05);
}

@keyframes ringPulse {
  0%, 100% { box-shadow: 0 0 80px rgba(255,255,255,0.1), inset 0 0 60px rgba(255,255,255,0.03); }
  50% { box-shadow: 0 0 140px rgba(255,255,255,0.25), inset 0 0 100px rgba(255,255,255,0.08); }
}

@keyframes ringSpin {
  to { transform: rotate(360deg); }
}
.clock-face {
  width: 86%;
  height: 86%;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.8);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 40px rgba(255, 255, 255, 0.06), 0 0 40px rgba(255,255,255,0.2);
  background: #000;
}
.hand {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform-origin: bottom center;
  background: #fff;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.9), 0 0 50px rgba(255, 255, 255, 0.4);
}

.hand.hour {
  width: 5px;
  height: 25%;
  margin-left: -2.5px;
  animation: spinHour 6s linear forwards;
}

.hand.minute {
  width: 3px;
  height: 36%;
  margin-left: -1.5px;
  background: rgba(255, 255, 255, 0.9);
  animation: spinMinute 6s linear forwards;
}

.hand.second {
  width: 1.5px;
  height: 43%;
  margin-left: -0.75px;
  background: #fff;
  box-shadow: 0 0 30px rgba(255, 255, 255, 1), 0 0 70px rgba(255, 255, 255, 0.5);
  animation: spinSecond 6s linear forwards;
}

@keyframes spinHour {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes spinMinute {
  from { transform: rotate(0deg); }
  to { transform: rotate(1440deg); }
}
@keyframes spinSecond {
  from { transform: rotate(0deg); }
  to { transform: rotate(4320deg); }
}
.clock-center {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 30px #fff, 0 0 60px rgba(255,255,255,0.8);
  z-index: 5;
}
.tick {
  position: absolute;
  width: 3px;
  height: 14px;
  background: #fff;
  border-radius: 1px;
  top: 10px;
  left: 50%;
  transform-origin: 50% calc(min(75vmin, 560px) * 0.43);
  box-shadow: 0 0 10px rgba(255,255,255,0.5);
}
.clock-face::before {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.clock-face::after {
  content: '';
  position: absolute;
  inset: 30px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.2);
}
#fish-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.terminal-float {
  position: absolute;
  top: 12%;
  left: 8%;
  background: rgba(10, 10, 20, 0.85);
  color: #9cdcfe;
  padding: 16px 20px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  min-width: 280px;
  max-width: 60vw;
  min-height: 70px;
  z-index: 10;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(201, 160, 255, 0.2);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
}

.terminal-float pre {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  font-family: 'Courier New', ui-monospace, monospace;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  color: inherit;
}
.ghost-btn {
  position: absolute;
  bottom: 40px;
  background: transparent;
  border: 2px solid var(--blue);
  color: var(--blue);
  padding: 10px 28px;
  border-radius: 30px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s;
  z-index: 20;
}

.ghost-btn:hover {
  background: var(--blue);
  color: #fff;
}
#next-to-game {
  display: none !important;
}
.card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 48px;
  max-width: 560px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.card h2 {
  font-size: 20px;
  margin-bottom: 28px;
  color: var(--blue);
}

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option {
  padding: 14px 20px;
  border: 2px solid #e5e0d5;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-size: 15px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: #fff;
  font-family: inherit;
  color: var(--ink);
}

.option:hover {
  border-color: var(--blue);
  transform: translateX(4px);
}

.option.picked {
  border-color: #c9a0ff;
  background: #faf5ff;
}

.feedback {
  margin-top: 20px;
  font-size: 14px;
  color: var(--muted);
  min-height: 20px;
  transition: color 0.3s;
}
.letter {
  background: #fff;
  width: min(520px, 88vw);
  padding: 48px 44px;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  transform: translateY(30px) scale(0.96);
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.scene.active .letter {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.letter-inner p {
  margin-bottom: 18px;
  line-height: 1.8;
  font-size: 15px;
}

.sign {
  text-align: right;
  color: var(--blue);
  font-weight: bold;
}

.easter-egg {
  position: fixed;
  right: 14px;
  bottom: 10px;
  font-size: 10px;
  color: #c8c2b4;
  user-select: none;
}
#typewriter {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.6;
  color: #c9d1d9;
  max-height: 60vh;
  overflow-y: auto;
}