:root {
  --cork-base: #b88856;
  --cork-dark: #94683b;
  --cork-light: #cea06e;
  --wood-frame: #243b2f;
  --wood-trim: #17271f;
  --paper-cream: #fbf9f3;
  --paper-yellow: #fdf2c4;
  --ink: #1f2421;
  --ink-soft: #4a534d;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Full-Bleed Tactile Corkboard Surface with Subtle Panel Seams & Wooden Frame */
body {
  min-height: 100vh;
  background-color: var(--cork-base);
  background-image:
    linear-gradient(90deg, transparent 49.85%, rgba(62, 38, 16, 0.22) 50%, transparent 50.15%),
    linear-gradient(0deg, transparent 74.85%, rgba(62, 38, 16, 0.16) 75%, transparent 75.15%),
    radial-gradient(rgba(68, 41, 17, 0.26) 1.2px, transparent 0),
    radial-gradient(rgba(255, 242, 218, 0.28) 1px, transparent 0),
    radial-gradient(rgba(105, 66, 28, 0.2) 1.7px, transparent 0);
  background-size: 100% 100%, 100% 560px, 23px 23px, 18px 18px, 35px 35px;
  background-position: 0 0, 0 0, 0 0, 7px 11px, 14px 6px;
  border: 12px solid var(--wood-frame);
  box-shadow: inset 0 0 42px rgba(32, 18, 7, 0.34);
}

@media (max-width: 640px) {
  body {
    border-width: 7px;
  }
}

.font-hand {
  font-family: 'Caveat', cursive;
}

.font-retro {
  font-family: 'Pacifico', cursive;
}

/* Ruled Notebook Paper with Crisp Horizontal Lines (#cbd5e1) & Subtle Red Margin Line */
.ruled-sheet {
  background-color: var(--paper-cream);
  background-image:
    linear-gradient(90deg, transparent 34px, rgba(220, 88, 88, 0.24) 34px, rgba(220, 88, 88, 0.24) 35.5px, transparent 35.5px),
    repeating-linear-gradient(
      to bottom,
      transparent 0px,
      transparent 26px,
      #cbd5e1 27px
    );
  border: 1px solid #dfd6c3;
  box-shadow:
    0 10px 22px rgba(38, 22, 9, 0.24),
    0 2px 5px rgba(0, 0, 0, 0.12);
  position: relative;
}

/* Compact Ruled Paper Card (Horizontal Lines #cbd5e1 without Margin Line) */
.ruled-note {
  background-color: var(--paper-cream);
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0px,
      transparent 24px,
      #cbd5e1 25px
    );
  border: 1px solid #dfd6c3;
  box-shadow:
    0 10px 22px rgba(38, 22, 9, 0.24),
    0 2px 5px rgba(0, 0, 0, 0.12);
  position: relative;
}

/* Unlined Tactile Index Card (Used for Colored/Pillar Cards & Header Bar) */
.index-card {
  background-color: var(--paper-cream);
  border: 1px solid #dfd6c3;
  box-shadow:
    0 8px 18px rgba(38, 22, 9, 0.22),
    0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
}

/* Warm Cream Note Banner */
.cream-banner {
  background-color: #fbf7ec;
  border: 1px solid #ddd2bc;
  box-shadow:
    0 9px 20px rgba(38, 22, 9, 0.24),
    0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
}

/* Colored Yellow Sticky Note (Unlined) */
.sticky-yellow {
  background-color: var(--paper-yellow);
  border: 1px solid #e5d491;
  box-shadow:
    0 8px 16px rgba(38, 22, 9, 0.24),
    0 2px 3px rgba(0, 0, 0, 0.1);
  position: relative;
}

/* Realistic 3D Slate-Green Push Pin (.pinned elements ONLY) */
.slate-pin {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #9eb0a5 0%, #485e51 55%, #1e2b24 100%);
  box-shadow:
    4px 7px 7px rgba(28, 17, 7, 0.52),
    1px 2px 2px rgba(0, 0, 0, 0.35),
    inset 0 1.5px 2px rgba(255, 255, 255, 0.48);
  position: absolute;
  z-index: 15;
  pointer-events: none;
}

.slate-pin::after {
  content: "";
  position: absolute;
  top: 3.5px;
  left: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
}

/* Translucent Masking & Washi Tape Strips (.taped elements ONLY) */
.masking-tape {
  background: rgba(244, 234, 208, 0.9);
  border-left: 1.5px dashed rgba(138, 121, 90, 0.52);
  border-right: 1.5px dashed rgba(138, 121, 90, 0.52);
  box-shadow: 0 2px 4px rgba(34, 20, 8, 0.22);
  backdrop-filter: blur(1px);
  position: absolute;
  z-index: 14;
  pointer-events: none;
}

.washi-tape {
  border-left: 1.5px dashed rgba(255, 255, 255, 0.48);
  border-right: 1.5px dashed rgba(255, 255, 255, 0.48);
  box-shadow: 0 2px 5px rgba(34, 20, 8, 0.24);
  backdrop-filter: blur(0.5px);
  position: absolute;
  z-index: 14;
  pointer-events: none;
}

/* Scattered Extracted Corkboard Cutout Wrapper */
.cutout-slot {
  position: relative;
  display: inline-block;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.cutout-slot:hover {
  filter: drop-shadow(0 10px 16px rgba(28, 16, 6, 0.34));
}

/* ===================================================================== */
/* STANDALONE ARCADE CLAW MACHINE CABINET (Fixed 600px Viewport Height)  */
/* ===================================================================== */
.arcade-stage {
  width: 100%;
  height: 600px;
  max-height: 600px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.arcade-cabinet {
  width: 100%;
  max-width: 680px;
  height: 594px;
  background: linear-gradient(180deg, #2c473a 0%, #243b30 62%, #1f3329 100%);
  border: 4px solid #15231c;
  border-radius: 26px 26px 16px 16px;
  box-shadow:
    0 18px 34px rgba(24, 14, 6, 0.42),
    inset 0 2px 4px rgba(255, 255, 255, 0.16);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 18px 12px 18px;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

/* Warm Parchment & Gold Cabinet Side Pillars */
.arcade-cabinet::before,
.arcade-cabinet::after {
  content: "";
  position: absolute;
  top: 58px;
  bottom: 92px;
  width: 7px;
  background: linear-gradient(180deg, #fbf9f4 0%, #e5d7b7 50%, #d4a234 100%);
  border: 1px solid #182820;
  border-radius: 4px;
}
.arcade-cabinet::before { left: 5px; }
.arcade-cabinet::after { right: 5px; }

/* Sculpted Cabinet Top Canopy / Marquee */
.arcade-marquee {
  height: 54px;
  background: linear-gradient(180deg, #fbf9f4 0%, #f1e6cc 100%);
  border: 3px solid #d4a234;
  border-radius: 16px 16px 10px 10px;
  box-shadow:
    inset 0 0 18px rgba(212, 162, 52, 0.42),
    0 4px 8px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  position: relative;
  overflow: hidden;
}

.arcade-marquee::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 46%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.marquee-title-text {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #17271f;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9),
    0 2px 6px rgba(212, 162, 52, 0.45);
  z-index: 10;
}

@media (max-width: 520px) {
  .marquee-title-text {
    font-size: 1.02rem;
    letter-spacing: 0.14em;
  }
}

/* 3-Bulb Arcade Indicator Light Bank */
.marquee-bulb-bank {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #182820;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1.5px solid #d4a234;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.65);
  z-index: 10;
}

.marquee-bulb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background-color: #d4a234;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 4px rgba(212, 162, 52, 0.5);
  transition: background-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

@keyframes bulbIdle {
  0%, 100% { opacity: 0.45; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.05); }
}

@keyframes bulbGrabFlash {
  0%, 100% { opacity: 0.28; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
}

.marquee-bulb.idle {
  animation: bulbIdle 1.8s infinite ease-in-out;
}
.marquee-bulb.idle:nth-child(2) { animation-delay: 0.3s; }
.marquee-bulb.idle:nth-child(3) { animation-delay: 0.6s; }

.marquee-bulb.flashing {
  animation: bulbGrabFlash 0.34s infinite ease-in-out;
}
.marquee-bulb.flashing:nth-child(2) { animation-delay: 0.11s; }
.marquee-bulb.flashing:nth-child(3) { animation-delay: 0.22s; }

/* Brushed Metal & Tempered Glass Display Case */
.glass-bezel {
  flex: 1;
  margin: 8px 0;
  background: linear-gradient(180deg, #c2b9a5 0%, #9b917c 100%);
  border: 4px solid #1f3329;
  border-radius: 12px;
  padding: 5px;
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.42),
    0 2px 0 rgba(212, 162, 52, 0.25);
  display: flex;
  flex-direction: column;
}

.viewport-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  background: #fbf9f4;
  border: 2px solid #59665f;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 6px 18px rgba(24, 34, 28, 0.14);
}

/* Subtle Corner & Diagonal Glass Reflections */
.glass-glare {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 14%, rgba(255, 255, 255, 0.42) 0%, transparent 24%),
    radial-gradient(circle at 90% 16%, rgba(255, 255, 255, 0.28) 0%, transparent 20%),
    linear-gradient(
      118deg,
      rgba(255, 255, 255, 0.28) 0%,
      rgba(255, 255, 255, 0.06) 28%,
      transparent 29%,
      transparent 66%,
      rgba(255, 255, 255, 0.1) 67%,
      transparent 84%
    );
  pointer-events: none;
  z-index: 8;
}

#clawCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Slanted Lower Control Console */
.arcade-deck {
  height: 84px;
  background: linear-gradient(180deg, #fbf9f4 0%, #e5dac1 16%, #2c473a 18%, #1f3329 65%, #16241d 100%);
  border: 3px solid #d4a234;
  border-radius: 12px 12px 14px 14px;
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.25),
    0 -2px 6px rgba(0, 0, 0, 0.35);
  padding: 14px 16px 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
}

/* Tactile Arcade Joystick Visual */
.joystick-assembly {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle, #182820 38%, #4c5b52 42%, #29362f 100%);
  border: 2px solid #d4a234;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6), 0 2px 3px rgba(255, 255, 255, 0.14);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.joystick-shaft {
  width: 7px;
  height: 21px;
  background: linear-gradient(90deg, #8b9991, #dce5df, #64736b);
  border-radius: 4px;
  position: absolute;
  bottom: 23px;
  transform-origin: bottom center;
  transition: transform 0.1s ease;
}

.joystick-ball {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #83c4a0 0%, #3e7b5c 58%, #214734 100%);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5), inset 0 1.5px 2px rgba(255, 255, 255, 0.55);
  position: absolute;
  top: -13px;
  left: -8px;
}

/* Arcade Push Buttons */
.arcade-btn-nav {
  background: linear-gradient(180deg, #fbf9f4 0%, #e5dcc7 100%);
  color: #1f2421;
  border: 2px solid #182820;
  border-bottom-width: 5px;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.06s ease, border-bottom-width 0.06s ease;
}

.arcade-btn-nav:active:not(:disabled) {
  transform: translateY(3px);
  border-bottom-width: 2px;
}

.arcade-btn-drop {
  background: linear-gradient(180deg, #d9645d 0%, #b8443d 100%);
  color: #fffdf8;
  border: 2px solid #182820;
  border-bottom-width: 6px;
  border-radius: 999px;
  padding: 9px 22px;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.06s ease, border-bottom-width 0.06s ease;
}

.arcade-btn-drop:active:not(:disabled) {
  transform: translateY(4px);
  border-bottom-width: 2px;
}

.arcade-btn-nav:disabled,
.arcade-btn-drop:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

/* Drawn Capsule Ruled Note Overlay (Uses Tape Only, Zero Pins) */
.note-overlay {
  position: absolute;
  inset: 0;
  background: rgba(24, 34, 28, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
  z-index: 25;
}

.note-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.note-card {
  border: 2px solid #d9cbb5;
  border-radius: 14px;
  max-width: 440px;
  width: 100%;
  padding: 26px 26px 22px 26px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.32);
  transform: translateY(10px);
  transition: transform 0.24s ease;
  position: relative;
}

.note-overlay.visible .note-card {
  transform: translateY(0);
}
