/* SnapStream Snapped v2 - Clean Styles */

/* Poppins font - locally hosted */
@font-face {
  font-family: 'Poppins';
  font-weight: 900;
  font-style: normal;
  src: url('fonts/poppins-black.ttf') format('truetype');
}
@font-face {
  font-family: 'Poppins';
  font-weight: 900;
  font-style: italic;
  src: url('fonts/poppins-black-italic.ttf') format('truetype');
}

:root {
  --font: 'Poppins', system-ui, sans-serif;
  --font-mono: 'Courier New', Courier, monospace;
  --white: #fff;
  --white-dim: rgba(255, 255, 255, 0.7);
  --black: #000;
  --black-dim: rgba(0, 0, 0, 0.7);
}

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

/* Hide icon font text until font loads */
.material-symbols-rounded {
  display: inline-block;
  width: 1em;
  height: 1em;
  overflow: hidden;
  vertical-align: middle;
  visibility: hidden;
}
body.fonts-loaded .material-symbols-rounded {
  visibility: visible;
}

body {
  font-family: var(--font);
  background: #1a1a2e;
  color: var(--white);
  overflow: hidden;
  min-height: 100vh;
}

/* ==================== Header ==================== */

#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 2.25rem 3rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

body.playing #header { opacity: 1; }

.logo {
  display: flex;
  flex-direction: column;
  width: 20vw;
  container-type: inline-size;
}

.logo img {
  width: 600px;
  max-width: 100%;
  filter: brightness(0) invert(1);
}

.logo .badge {
  font-family: var(--font-display);
  font-size: 10cqw;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.1em;
  text-align: right;
  margin-top: 0.25rem;
}

.user-info {
  text-align: right;
  width: 20vw;
  container-type: inline-size;
}

.user-name {
  font-family: var(--font-display);
  font-size: 12cqw;
  font-weight: 700;
  line-height: 1.1;
}

.user-org {
  font-family: var(--font-display);
  font-size: 8cqw;
  color: var(--white-dim);
  margin-top: 0.25rem;
}

/* ==================== Start Screen ==================== */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(0, 154, 222, 1) 0%, rgba(0, 0, 0, 1) 60%);
}

.overlay.hidden { display: none; }

.start-content {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  width: 100%;
  padding: 3vw;
  padding-top: 3vh;
}

.start-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  width: 100%;
  margin-bottom: 3vw;
}

.start-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: visible;
  padding-right: 0.5vw;
}

.start-right {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  width: 100%;
  padding-left: 0.5vw;
  padding-right: 1vw;
  overflow: hidden;
}

.start-logo {
  display: block;
  width: 80%;
  max-width: 400px;
  height: auto;
  margin: 2vw auto -0.5vw;
  filter: drop-shadow(0.15vw 0.15vw 0.1vw rgba(0, 0, 0, 0.5));
  position: relative;
  z-index: 2;
}

.start-year {
  font-size: 20vw;
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: -0.03em;
  color: #FFD700;
  position: relative;
  z-index: 1;
  text-shadow:
    /* Sharp gold-to-black extrusion - 2x resolution (0.1vw to 30vw) */
    0.1vw 0.1vw 0 rgb(56, 42, 8),
    0.2vw 0.2vw 0 rgb(56, 42, 8),
    0.3vw 0.3vw 0 rgb(55, 41, 8),
    0.4vw 0.4vw 0 rgb(55, 41, 8),
    0.5vw 0.5vw 0 rgb(54, 41, 7),
    0.6vw 0.6vw 0 rgb(54, 40, 7),
    0.7vw 0.7vw 0 rgb(53, 40, 7),
    0.8vw 0.8vw 0 rgb(53, 40, 7),
    0.9vw 0.9vw 0 rgb(52, 39, 7),
    1.0vw 1.0vw 0 rgb(52, 39, 7),
    1.1vw 1.1vw 0 rgb(51, 38, 6),
    1.2vw 1.2vw 0 rgb(51, 38, 6),
    1.3vw 1.3vw 0 rgb(50, 38, 6),
    1.4vw 1.4vw 0 rgb(50, 37, 6),
    1.5vw 1.5vw 0 rgb(49, 37, 6),
    1.6vw 1.6vw 0 rgb(49, 36, 6),
    1.7vw 1.7vw 0 rgb(48, 36, 5),
    1.8vw 1.8vw 0 rgb(48, 36, 5),
    1.9vw 1.9vw 0 rgb(47, 35, 5),
    2.0vw 2.0vw 0 rgb(47, 35, 5),
    2.1vw 2.1vw 0 rgb(46, 35, 5),
    2.2vw 2.2vw 0 rgb(46, 34, 5),
    2.3vw 2.3vw 0 rgb(45, 34, 5),
    2.4vw 2.4vw 0 rgb(45, 33, 5),
    2.5vw 2.5vw 0 rgb(44, 33, 4),
    2.6vw 2.6vw 0 rgb(44, 33, 4),
    2.7vw 2.7vw 0 rgb(43, 32, 4),
    2.8vw 2.8vw 0 rgb(43, 32, 4),
    2.9vw 2.9vw 0 rgb(42, 31, 4),
    3.0vw 3.0vw 0 rgb(42, 31, 4),
    3.1vw 3.1vw 0 rgb(41, 31, 4),
    3.2vw 3.2vw 0 rgb(41, 30, 4),
    3.3vw 3.3vw 0 rgb(40, 30, 3),
    3.4vw 3.4vw 0 rgb(40, 30, 3),
    3.5vw 3.5vw 0 rgb(39, 29, 3),
    3.6vw 3.6vw 0 rgb(39, 29, 3),
    3.7vw 3.7vw 0 rgb(38, 28, 3),
    3.8vw 3.8vw 0 rgb(38, 28, 3),
    3.9vw 3.9vw 0 rgb(37, 28, 3),
    4.0vw 4.0vw 0 rgb(37, 27, 3),
    4.1vw 4.1vw 0 rgb(36, 27, 2),
    4.2vw 4.2vw 0 rgb(36, 27, 2),
    4.3vw 4.3vw 0 rgb(35, 26, 2),
    4.4vw 4.4vw 0 rgb(35, 26, 2),
    4.5vw 4.5vw 0 rgb(34, 25, 2),
    4.6vw 4.6vw 0 rgb(34, 25, 2),
    4.7vw 4.7vw 0 rgb(33, 25, 2),
    4.8vw 4.8vw 0 rgb(33, 24, 2),
    4.9vw 4.9vw 0 rgb(32, 24, 2),
    5.0vw 5.0vw 0 rgb(32, 24, 2),
    5.1vw 5.1vw 0 rgb(31, 23, 1),
    5.2vw 5.2vw 0 rgb(31, 23, 1),
    5.3vw 5.3vw 0 rgb(30, 22, 1),
    5.4vw 5.4vw 0 rgb(30, 22, 1),
    5.5vw 5.5vw 0 rgb(29, 22, 1),
    5.6vw 5.6vw 0 rgb(29, 21, 1),
    5.7vw 5.7vw 0 rgb(28, 21, 1),
    5.8vw 5.8vw 0 rgb(28, 21, 1),
    5.9vw 5.9vw 0 rgb(27, 20, 1),
    6.0vw 6.0vw 0 rgb(27, 20, 1),
    6.1vw 6.1vw 0 rgb(26, 19, 1),
    6.2vw 6.2vw 0 rgb(26, 19, 1),
    6.3vw 6.3vw 0 rgb(25, 19, 0),
    6.4vw 6.4vw 0 rgb(25, 18, 0),
    6.5vw 6.5vw 0 rgb(24, 18, 0),
    6.6vw 6.6vw 0 rgb(24, 18, 0),
    6.7vw 6.7vw 0 rgb(23, 17, 0),
    6.8vw 6.8vw 0 rgb(23, 17, 0),
    6.9vw 6.9vw 0 rgb(22, 16, 0),
    7.0vw 7.0vw 0 rgb(22, 16, 0),
    7.1vw 7.1vw 0 rgb(21, 16, 0),
    7.2vw 7.2vw 0 rgb(21, 15, 0),
    7.3vw 7.3vw 0 rgb(20, 15, 0),
    7.4vw 7.4vw 0 rgb(20, 15, 0),
    7.5vw 7.5vw 0 rgb(19, 14, 0),
    7.6vw 7.6vw 0 rgb(19, 14, 0),
    7.7vw 7.7vw 0 rgb(18, 13, 0),
    7.8vw 7.8vw 0 rgb(18, 13, 0),
    7.9vw 7.9vw 0 rgb(17, 13, 0),
    8.0vw 8.0vw 0 rgb(17, 12, 0),
    8.1vw 8.1vw 0 rgb(16, 12, 0),
    8.2vw 8.2vw 0 rgb(16, 12, 0),
    8.3vw 8.3vw 0 rgb(15, 11, 0),
    8.4vw 8.4vw 0 rgb(15, 11, 0),
    8.5vw 8.5vw 0 rgb(14, 10, 0),
    8.6vw 8.6vw 0 rgb(14, 10, 0),
    8.7vw 8.7vw 0 rgb(13, 10, 0),
    8.8vw 8.8vw 0 rgb(13, 9, 0),
    8.9vw 8.9vw 0 rgb(12, 9, 0),
    9.0vw 9.0vw 0 rgb(12, 9, 0),
    9.1vw 9.1vw 0 rgb(11, 8, 0),
    9.2vw 9.2vw 0 rgb(11, 8, 0),
    9.3vw 9.3vw 0 rgb(10, 7, 0),
    9.4vw 9.4vw 0 rgb(10, 7, 0),
    9.5vw 9.5vw 0 rgb(9, 7, 0),
    9.6vw 9.6vw 0 rgb(9, 6, 0),
    9.7vw 9.7vw 0 rgb(8, 6, 0),
    9.8vw 9.8vw 0 rgb(8, 6, 0),
    9.9vw 9.9vw 0 rgb(7, 5, 0),
    10.0vw 10.0vw 0 rgb(7, 5, 0),
    10.1vw 10.1vw 0 rgb(6, 4, 0),
    10.2vw 10.2vw 0 rgb(6, 4, 0),
    10.3vw 10.3vw 0 rgb(5, 4, 0),
    10.4vw 10.4vw 0 rgb(5, 3, 0),
    10.5vw 10.5vw 0 rgb(4, 3, 0),
    10.6vw 10.6vw 0 rgb(4, 3, 0),
    10.7vw 10.7vw 0 rgb(3, 2, 0),
    10.8vw 10.8vw 0 rgb(3, 2, 0),
    10.9vw 10.9vw 0 rgb(2, 1, 0),
    11.0vw 11.0vw 0 rgb(2, 1, 0),
    11.1vw 11.1vw 0 rgb(1, 1, 0),
    11.2vw 11.2vw 0 rgb(1, 0, 0),
    11.3vw 11.3vw 0 #000,
    11.4vw 11.4vw 0 #000,
    11.5vw 11.5vw 0 #000,
    11.6vw 11.6vw 0 #000,
    11.7vw 11.7vw 0 #000,
    11.8vw 11.8vw 0 #000,
    11.9vw 11.9vw 0 #000,
    12.0vw 12.0vw 0 #000,
    12.1vw 12.1vw 0 #000,
    12.2vw 12.2vw 0 #000,
    12.3vw 12.3vw 0 #000,
    12.4vw 12.4vw 0 #000,
    12.5vw 12.5vw 0 #000,
    12.6vw 12.6vw 0 #000,
    12.7vw 12.7vw 0 #000,
    12.8vw 12.8vw 0 #000,
    12.9vw 12.9vw 0 #000,
    13.0vw 13.0vw 0 #000,
    13.1vw 13.1vw 0 #000,
    13.2vw 13.2vw 0 #000,
    13.3vw 13.3vw 0 #000,
    13.4vw 13.4vw 0 #000,
    13.5vw 13.5vw 0 #000,
    13.6vw 13.6vw 0 #000,
    13.7vw 13.7vw 0 #000,
    13.8vw 13.8vw 0 #000,
    13.9vw 13.9vw 0 #000,
    14.0vw 14.0vw 0 #000,
    14.1vw 14.1vw 0 #000,
    14.2vw 14.2vw 0 #000,
    14.3vw 14.3vw 0 #000,
    14.4vw 14.4vw 0 #000,
    14.5vw 14.5vw 0 #000,
    14.6vw 14.6vw 0 #000,
    14.7vw 14.7vw 0 #000,
    14.8vw 14.8vw 0 #000,
    14.9vw 14.9vw 0 #000,
    15.0vw 15.0vw 0 #000,
    15.1vw 15.1vw 0 #000,
    15.2vw 15.2vw 0 #000,
    15.3vw 15.3vw 0 #000,
    15.4vw 15.4vw 0 #000,
    15.5vw 15.5vw 0 #000,
    15.6vw 15.6vw 0 #000,
    15.7vw 15.7vw 0 #000,
    15.8vw 15.8vw 0 #000,
    15.9vw 15.9vw 0 #000,
    16.0vw 16.0vw 0 #000,
    16.1vw 16.1vw 0 #000,
    16.2vw 16.2vw 0 #000,
    16.3vw 16.3vw 0 #000,
    16.4vw 16.4vw 0 #000,
    16.5vw 16.5vw 0 #000,
    16.6vw 16.6vw 0 #000,
    16.7vw 16.7vw 0 #000,
    16.8vw 16.8vw 0 #000,
    16.9vw 16.9vw 0 #000,
    17.0vw 17.0vw 0 #000,
    17.1vw 17.1vw 0 #000,
    17.2vw 17.2vw 0 #000,
    17.3vw 17.3vw 0 #000,
    17.4vw 17.4vw 0 #000,
    17.5vw 17.5vw 0 #000,
    17.6vw 17.6vw 0 #000,
    17.7vw 17.7vw 0 #000,
    17.8vw 17.8vw 0 #000,
    17.9vw 17.9vw 0 #000,
    18.0vw 18.0vw 0 #000,
    18.1vw 18.1vw 0 #000,
    18.2vw 18.2vw 0 #000,
    18.3vw 18.3vw 0 #000,
    18.4vw 18.4vw 0 #000,
    18.5vw 18.5vw 0 #000,
    18.6vw 18.6vw 0 #000,
    18.7vw 18.7vw 0 #000,
    18.8vw 18.8vw 0 #000,
    18.9vw 18.9vw 0 #000,
    19.0vw 19.0vw 0 #000,
    19.1vw 19.1vw 0 #000,
    19.2vw 19.2vw 0 #000,
    19.3vw 19.3vw 0 #000,
    19.4vw 19.4vw 0 #000,
    19.5vw 19.5vw 0 #000,
    19.6vw 19.6vw 0 #000,
    19.7vw 19.7vw 0 #000,
    19.8vw 19.8vw 0 #000,
    19.9vw 19.9vw 0 #000,
    20.0vw 20.0vw 0 #000,
    20.1vw 20.1vw 0 #000,
    20.2vw 20.2vw 0 #000,
    20.3vw 20.3vw 0 #000,
    20.4vw 20.4vw 0 #000,
    20.5vw 20.5vw 0 #000,
    20.6vw 20.6vw 0 #000,
    20.7vw 20.7vw 0 #000,
    20.8vw 20.8vw 0 #000,
    20.9vw 20.9vw 0 #000,
    21.0vw 21.0vw 0 #000,
    21.1vw 21.1vw 0 #000,
    21.2vw 21.2vw 0 #000,
    21.3vw 21.3vw 0 #000,
    21.4vw 21.4vw 0 #000,
    21.5vw 21.5vw 0 #000,
    21.6vw 21.6vw 0 #000,
    21.7vw 21.7vw 0 #000,
    21.8vw 21.8vw 0 #000,
    21.9vw 21.9vw 0 #000,
    22.0vw 22.0vw 0 #000,
    22.1vw 22.1vw 0 #000,
    22.2vw 22.2vw 0 #000,
    22.3vw 22.3vw 0 #000,
    22.4vw 22.4vw 0 #000,
    22.5vw 22.5vw 0 #000,
    22.6vw 22.6vw 0 #000,
    22.7vw 22.7vw 0 #000,
    22.8vw 22.8vw 0 #000,
    22.9vw 22.9vw 0 #000,
    23.0vw 23.0vw 0 #000,
    23.1vw 23.1vw 0 #000,
    23.2vw 23.2vw 0 #000,
    23.3vw 23.3vw 0 #000,
    23.4vw 23.4vw 0 #000,
    23.5vw 23.5vw 0 #000,
    23.6vw 23.6vw 0 #000,
    23.7vw 23.7vw 0 #000,
    23.8vw 23.8vw 0 #000,
    23.9vw 23.9vw 0 #000,
    24.0vw 24.0vw 0 #000,
    24.1vw 24.1vw 0 #000,
    24.2vw 24.2vw 0 #000,
    24.3vw 24.3vw 0 #000,
    24.4vw 24.4vw 0 #000,
    24.5vw 24.5vw 0 #000,
    24.6vw 24.6vw 0 #000,
    24.7vw 24.7vw 0 #000,
    24.8vw 24.8vw 0 #000,
    24.9vw 24.9vw 0 #000,
    25.0vw 25.0vw 0 #000,
    25.1vw 25.1vw 0 #000,
    25.2vw 25.2vw 0 #000,
    25.3vw 25.3vw 0 #000,
    25.4vw 25.4vw 0 #000,
    25.5vw 25.5vw 0 #000,
    25.6vw 25.6vw 0 #000,
    25.7vw 25.7vw 0 #000,
    25.8vw 25.8vw 0 #000,
    25.9vw 25.9vw 0 #000,
    26.0vw 26.0vw 0 #000,
    26.1vw 26.1vw 0 #000,
    26.2vw 26.2vw 0 #000,
    26.3vw 26.3vw 0 #000,
    26.4vw 26.4vw 0 #000,
    26.5vw 26.5vw 0 #000,
    26.6vw 26.6vw 0 #000,
    26.7vw 26.7vw 0 #000,
    26.8vw 26.8vw 0 #000,
    26.9vw 26.9vw 0 #000,
    27.0vw 27.0vw 0 #000,
    27.1vw 27.1vw 0 #000,
    27.2vw 27.2vw 0 #000,
    27.3vw 27.3vw 0 #000,
    27.4vw 27.4vw 0 #000,
    27.5vw 27.5vw 0 #000,
    27.6vw 27.6vw 0 #000,
    27.7vw 27.7vw 0 #000,
    27.8vw 27.8vw 0 #000,
    27.9vw 27.9vw 0 #000,
    28.0vw 28.0vw 0 #000,
    28.1vw 28.1vw 0 #000,
    28.2vw 28.2vw 0 #000,
    28.3vw 28.3vw 0 #000,
    28.4vw 28.4vw 0 #000,
    28.5vw 28.5vw 0 #000,
    28.6vw 28.6vw 0 #000,
    28.7vw 28.7vw 0 #000,
    28.8vw 28.8vw 0 #000,
    28.9vw 28.9vw 0 #000,
    29.0vw 29.0vw 0 #000,
    29.1vw 29.1vw 0 #000,
    29.2vw 29.2vw 0 #000,
    29.3vw 29.3vw 0 #000,
    29.4vw 29.4vw 0 #000,
    29.5vw 29.5vw 0 #000,
    29.6vw 29.6vw 0 #000,
    29.7vw 29.7vw 0 #000,
    29.8vw 29.8vw 0 #000,
    29.9vw 29.9vw 0 #000,
    30.0vw 30.0vw 0 #000;
}

.start-year-svg {
  width: 45vw;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
}

.start-title {
  display: block;
  font-size: 9vw;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 2vw;
  width: 100%;
  text-shadow: 0.4vw 0.4vw 0.1vw rgba(0, 0, 0, 0.9);
  position: relative;
  z-index: 2;
}

.start-btn {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1vw;
  width: 66.67%;
  margin-left: auto;
  margin-right: auto;
  height: 8vw;
  padding: 0 3vw;
  font-size: 4vw;
  font-weight: 700;
  letter-spacing: normal;
  color: var(--white);
  background: rgba(255, 255, 255, 0.35);
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 0.15vw solid var(--white);
  border-radius: 5vw;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
  overflow: hidden;
}

.start-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--white);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease, opacity 0.1s ease;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
}

.start-btn:hover::before {
  opacity: 1;
  transform: scaleX(1);
}

.start-btn .btn-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1vw;
  color: white;
  transition: color 0.4s ease;
}

.start-btn:hover .btn-content {
  color: black;
}

.start-btn .material-symbols-rounded {
  font-size: 1.5em;
}

.start-btn .play-icon-svg {
  width: 1.5em;
  height: 1.5em;
}

.start-btn em {
  text-transform: uppercase;
}

.start-btn {
  opacity: 1; /* TEMP: visible for debugging */
  transform: scale(1);
  visibility: visible;
}

.start-btn.animate-in {
  visibility: visible;
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.start-subtitle {
  position: relative;
  z-index: 10;
  margin: 4vw auto 0;
  font-size: 2.5vw;
  font-weight: 400;
  font-style: italic;
  color: white;
  text-align: center;
  letter-spacing: 0.01em;
}

.start-subtitle .subtitle-text {
  font-family: var(--font-mono);
}

.start-subtitle .cursor {
  display: inline-block;
  width: 0.15em;
  height: 1.1em;
  background: white;
  margin-left: 0.05em;
  vertical-align: text-bottom;
  animation: blink 0.6s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Start screen entrance animations */
.start-overlay-fade {
  display: none; /* TEMP: disabled for debugging */
}

.start-overlay-fade.fade-out {
  opacity: 0;
}

.start-logo {
  opacity: 1; /* TEMP: visible for debugging */
  transform: scale(1);
}

.start-logo.animate-in {
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.start-title {
  opacity: 1; /* TEMP: visible for debugging */
  transform: scale(1);
}

.start-title.animate-in {
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.start-subtitle {
  opacity: 0;
}

.start-subtitle.animate-in {
  opacity: 1;
}

/* ==================== Scenes ==================== */

#scenes {
  position: fixed;
  inset: 0;
}

.scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
}

.scene.active {
  opacity: 1;
  visibility: visible;
}

.scene-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

/* Animated spotlight circles */
.spotlight {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.35;
  filter: blur(60px);
  will-change: transform;
  transition: transform 8s ease-in-out, top 8s ease-in-out, left 8s ease-in-out;
}

.scene-icon {
  position: absolute;
  z-index: 1;
  font-family: 'Material Symbols Rounded';
  font-size: 40vw;
  color: var(--white);
  opacity: 0.18;
  pointer-events: none;
  top: 10%;
  left: 5%;
}

.content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template: 1fr / 1fr 1fr;
  height: 100%;
  padding: 18vh 4vw 18vh; /* Top padding for larger header, bottom for footer */
  gap: 2vw;
}

.text-pane {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: right;
  container-type: inline-size;
}

.chart-pane {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 0; /* Allow flex child to shrink */
  overflow: visible;
}

.title {
  font-size: clamp(1.5rem, 4vw, 3.5rem);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 2vh;
  opacity: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.3em;
}

.title-start {
  width: 100%;
  text-align: right;
  font-size: clamp(2rem, 5vw, 4.5rem);
  font-weight: 700;
  color: var(--white-dim);
}

.title-end {
  font-size: clamp(2rem, 5vw, 4.5rem);
  font-weight: 700;
  color: var(--white-dim);
  align-self: flex-start;
  padding-top: 0.15em; /* Slight offset to align with top of value text */
  position: relative;
  z-index: 1;
}

.title .value {
  font-size: clamp(3rem, 12vw, 12rem);
  font-weight: 900;
  color: #FFD700;
  line-height: 1;
  margin-bottom: 2.5vw;
  margin-right: 3vw;
  text-shadow:
    0.05vw 0.05vw 0 rgb(56, 42, 8),
    0.1vw 0.1vw 0 rgb(55, 41, 8),
    0.15vw 0.15vw 0 rgb(54, 41, 8),
    0.2vw 0.2vw 0 rgb(53, 40, 8),
    0.25vw 0.25vw 0 rgb(52, 39, 7),
    0.3vw 0.3vw 0 rgb(51, 39, 7),
    0.35vw 0.35vw 0 rgb(50, 38, 7),
    0.4vw 0.4vw 0 rgb(49, 37, 7),
    0.45vw 0.45vw 0 rgb(48, 36, 7),
    0.5vw 0.5vw 0 rgb(47, 36, 6),
    0.55vw 0.55vw 0 rgb(46, 35, 6),
    0.6vw 0.6vw 0 rgb(45, 34, 6),
    0.65vw 0.65vw 0 rgb(44, 33, 6),
    0.7vw 0.7vw 0 rgb(42, 32, 6),
    0.75vw 0.75vw 0 rgb(41, 31, 5),
    0.8vw 0.8vw 0 rgb(40, 30, 5),
    0.85vw 0.85vw 0 rgb(39, 29, 5),
    0.9vw 0.9vw 0 rgb(37, 28, 5),
    0.95vw 0.95vw 0 rgb(36, 27, 5),
    1vw 1vw 0 rgb(35, 26, 4),
    1.05vw 1.05vw 0 rgb(34, 26, 4),
    1.1vw 1.1vw 0 rgb(32, 24, 4),
    1.15vw 1.15vw 0 rgb(31, 23, 4),
    1.2vw 1.2vw 0 rgb(30, 22, 4),
    1.25vw 1.25vw 0 rgb(28, 21, 3),
    1.3vw 1.3vw 0 rgb(27, 20, 3),
    1.35vw 1.35vw 0 rgb(25, 19, 3),
    1.4vw 1.4vw 0 rgb(24, 18, 3),
    1.45vw 1.45vw 0 rgb(22, 17, 3),
    1.5vw 1.5vw 0 rgb(21, 16, 2),
    1.55vw 1.55vw 0 rgb(19, 15, 2),
    1.6vw 1.6vw 0 rgb(18, 14, 2),
    1.65vw 1.65vw 0 rgb(16, 12, 2),
    1.7vw 1.7vw 0 rgb(15, 11, 1),
    1.75vw 1.75vw 0 rgb(13, 10, 1),
    1.8vw 1.8vw 0 rgb(11, 9, 1),
    1.85vw 1.85vw 0 rgb(10, 7, 1),
    1.9vw 1.9vw 0 rgb(8, 6, 1),
    1.95vw 1.95vw 0 rgb(6, 5, 0),
    2vw 2vw 0 rgb(5, 4, 0),
    2.05vw 2.05vw 0 rgb(3, 2, 0),
    2.1vw 2.1vw 0 rgb(1, 1, 0),
    2.15vw 2.15vw 0 #000,
    2.2vw 2.2vw 0 #000;
}

.subtitle {
  font-size: clamp(1.25rem, 4vw, 3rem);
  font-weight: 600;
  color: var(--white-dim);
  line-height: 1.15;
  opacity: 0;
}

.subtitle-value {
  font-size: clamp(1.5rem, 5vw, 4rem);
  font-weight: 900;
  color: #FFD700;
  text-shadow: 0.15vw 0.15vw 0 rgba(0, 0, 0, 0.5);
}

/* ==================== Scene Variants ==================== */

/* Positive variant - user in top 50%, celebratory styling */
.scene[data-variant="positive"] .subtitle {
  color: var(--white);
}

/* Add subtle golden glow to positive scenes */
.scene[data-variant="positive"] .title .value {
  filter: drop-shadow(0 0 0.5vw rgba(255, 215, 0, 0.3));
}

/* Neutral variant - standard informational styling */
.scene[data-variant="neutral"] .subtitle {
  color: var(--white-dim);
}

/* Default variant - same as neutral */
.scene[data-variant="default"] .subtitle {
  color: var(--white-dim);
}

/* ==================== Scene Style Layouts ==================== */

/* Title-and-three-up: Header + 3 columns below */
.scene[data-style="title-and-three-up"] .content {
  grid-template-rows: auto 1fr;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2vw;
}

.scene[data-style="title-and-three-up"] .text-pane {
  grid-column: 1 / -1; /* Full width header */
  grid-row: 1;
  text-align: center;
  align-items: center;
}

.scene[data-style="title-and-three-up"] .chart-pane {
  grid-row: 2;
  /* Each chart gets one column automatically */
}

/* Mobile responsive: stack columns */
@media (max-width: 768px) {
  .scene[data-style="title-and-three-up"] .content {
    grid-template-columns: 1fr;
    grid-template-rows: auto repeat(3, 1fr);
  }

  .scene[data-style="title-and-three-up"] .chart-pane {
    grid-column: 1;
    grid-row: auto;
  }
}

/* Title-and-four-up: Header + 2x2 grid below */
.scene[data-style="title-and-four-up"] .content {
  grid-template-rows: auto 1fr 1fr;
  grid-template-columns: 1fr 1fr;
  gap: 2vw;
}

.scene[data-style="title-and-four-up"] .text-pane {
  grid-column: 1 / -1;
  grid-row: 1;
  text-align: center;
  align-items: center;
}

.scene[data-style="title-and-four-up"] .chart-pane {
  /* Items flow into 2x2 grid automatically */
}

/* Mobile responsive: stack into single column */
@media (max-width: 768px) {
  .scene[data-style="title-and-four-up"] .content {
    grid-template-columns: 1fr;
    grid-template-rows: auto repeat(4, 1fr);
  }

  .scene[data-style="title-and-four-up"] .chart-pane {
    grid-column: 1;
    grid-row: auto;
  }
}

/* Title-and-two-up: Header + 2 columns below */
.scene[data-style="title-and-two-up"] .content {
  grid-template-rows: auto 1fr;
  grid-template-columns: 1fr 1fr;
  gap: 2vw;
}

.scene[data-style="title-and-two-up"] .text-pane {
  grid-column: 1 / -1;
  grid-row: 1;
  text-align: center;
  align-items: center;
}

.scene[data-style="title-and-two-up"] .chart-pane {
  grid-row: 2;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .scene[data-style="title-and-two-up"] .content {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr 1fr;
  }
}

/* Full-width: Single centered content area */
.scene[data-style="full-width"] .content {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  justify-items: center;
  align-items: center;
}

.scene[data-style="full-width"] .text-pane {
  text-align: center;
  align-items: center;
}

/* Hide chrome: Hide header/controls when scene has hide_chrome flag */
.scene.hide-chrome {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
}

.scene.hide-chrome ~ #header,
.scene.hide-chrome ~ #controls,
.scene.hide-chrome ~ #navDots,
.scene.hide-chrome ~ #progress {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* ==================== Divider Scene ==================== */

.scene-divider .divider-content {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0;
}

.divider-text {
  text-align: center;
}

.divider-title {
  font-size: clamp(2.5rem, 10vw, 7rem);
  font-weight: 900;
  line-height: 1.1;
  margin: 0;
  opacity: 0;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #FFD700;
  text-shadow:
    0.05vw 0.05vw 0 rgb(56, 42, 8),
    0.1vw 0.1vw 0 rgb(55, 41, 8),
    0.15vw 0.15vw 0 rgb(54, 41, 8),
    0.2vw 0.2vw 0 rgb(53, 40, 8),
    0.25vw 0.25vw 0 rgb(52, 39, 7),
    0.3vw 0.3vw 0 rgb(51, 39, 7),
    0.35vw 0.35vw 0 rgb(50, 38, 7),
    0.4vw 0.4vw 0 rgb(49, 37, 7),
    0.45vw 0.45vw 0 rgb(48, 36, 7),
    0.5vw 0.5vw 0 rgb(47, 36, 6),
    0.55vw 0.55vw 0 rgb(46, 35, 6),
    0.6vw 0.6vw 0 rgb(45, 34, 6),
    0.65vw 0.65vw 0 rgb(44, 33, 6),
    0.7vw 0.7vw 0 rgb(42, 32, 6),
    0.75vw 0.75vw 0 rgb(41, 31, 5),
    0.8vw 0.8vw 0 rgb(40, 30, 5),
    0.85vw 0.85vw 0 rgb(39, 29, 5),
    0.9vw 0.9vw 0 rgb(37, 28, 5),
    0.95vw 0.95vw 0 rgb(36, 27, 5),
    1vw 1vw 0 rgb(35, 26, 4),
    1.05vw 1.05vw 0 rgb(34, 26, 4),
    1.1vw 1.1vw 0 rgb(32, 24, 4),
    1.15vw 1.15vw 0 rgb(31, 23, 4),
    1.2vw 1.2vw 0 rgb(30, 22, 4),
    1.25vw 1.25vw 0 rgb(28, 21, 3),
    1.3vw 1.3vw 0 rgb(27, 20, 3),
    1.35vw 1.35vw 0 rgb(25, 19, 3),
    1.4vw 1.4vw 0 rgb(24, 18, 3),
    1.45vw 1.45vw 0 rgb(22, 17, 3),
    1.5vw 1.5vw 0 rgb(21, 16, 2),
    1.55vw 1.55vw 0 rgb(19, 15, 2),
    1.6vw 1.6vw 0 rgb(18, 14, 2),
    1.65vw 1.65vw 0 rgb(16, 12, 2),
    1.7vw 1.7vw 0 rgb(15, 11, 1),
    1.75vw 1.75vw 0 rgb(13, 10, 1),
    1.8vw 1.8vw 0 rgb(11, 9, 1),
    1.85vw 1.85vw 0 rgb(10, 7, 1),
    1.9vw 1.9vw 0 rgb(8, 6, 1),
    1.95vw 1.95vw 0 rgb(6, 5, 0),
    2vw 2vw 0 rgb(5, 4, 0),
    2.05vw 2.05vw 0 rgb(3, 2, 0),
    2.1vw 2.1vw 0 rgb(1, 1, 0),
    2.15vw 2.15vw 0 #000,
    2.2vw 2.2vw 0 #000;
}

.divider-subtitle {
  font-size: clamp(1rem, 3vw, 1.5rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 1rem;
  opacity: 0;
}

/* Divider scene icon - centered and sized for interstitial */
.scene-divider .scene-icon {
  font-size: 50vw;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.1;
}

/* Divider with logo variant (Insights page) */
.divider-logo {
  display: block;
  width: clamp(200px, 40vw, 500px);
  height: auto;
  margin: 0 auto 1rem;
}

.divider-logo.hidden {
  display: none;
}

.divider-with-logo .divider-title {
  font-size: clamp(2rem, 8vw, 5rem);
  font-style: italic;
  margin-top: 0.5rem;
}

.divider-with-logo .divider-subtitle {
  font-size: clamp(1.25rem, 4vw, 2.5rem);
  max-width: 80%;
  margin-left: auto;
  margin-right: auto;
  margin-top: 2rem;
  line-height: 1.4;
}

/* ==================== Intro Scene ==================== */

.scene-intro .content {
  grid-template: 1fr / 2fr 1fr;
}

.intro-content {
  padding: 0;
}

.intro-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: right;
  padding-right: 3vw;
  overflow: visible;
}

.intro-hey {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 400;
  opacity: 0;
}

.intro-handle {
  font-size: clamp(4rem, 18vw, 14rem);
  font-weight: 900;
  opacity: 0;
  color: #FFD700;
  text-transform: uppercase;
  white-space: nowrap;
  position: relative;
  text-shadow:
    0.05vw 0.05vw 0 rgb(56, 42, 8),
    0.1vw 0.1vw 0 rgb(55, 41, 8),
    0.15vw 0.15vw 0 rgb(54, 41, 8),
    0.2vw 0.2vw 0 rgb(53, 40, 8),
    0.25vw 0.25vw 0 rgb(52, 39, 7),
    0.3vw 0.3vw 0 rgb(51, 39, 7),
    0.35vw 0.35vw 0 rgb(50, 38, 7),
    0.4vw 0.4vw 0 rgb(49, 37, 7),
    0.45vw 0.45vw 0 rgb(48, 36, 7),
    0.5vw 0.5vw 0 rgb(47, 36, 6),
    0.55vw 0.55vw 0 rgb(46, 35, 6),
    0.6vw 0.6vw 0 rgb(45, 34, 6),
    0.65vw 0.65vw 0 rgb(44, 33, 6),
    0.7vw 0.7vw 0 rgb(42, 32, 6),
    0.75vw 0.75vw 0 rgb(41, 31, 5),
    0.8vw 0.8vw 0 rgb(40, 30, 5),
    0.85vw 0.85vw 0 rgb(39, 29, 5),
    0.9vw 0.9vw 0 rgb(37, 28, 5),
    0.95vw 0.95vw 0 rgb(36, 27, 5),
    1vw 1vw 0 rgb(35, 26, 4),
    1.05vw 1.05vw 0 rgb(34, 26, 4),
    1.1vw 1.1vw 0 rgb(32, 24, 4),
    1.15vw 1.15vw 0 rgb(31, 23, 4),
    1.2vw 1.2vw 0 rgb(30, 22, 4),
    1.25vw 1.25vw 0 rgb(28, 21, 3),
    1.3vw 1.3vw 0 rgb(27, 20, 3),
    1.35vw 1.35vw 0 rgb(25, 19, 3),
    1.4vw 1.4vw 0 rgb(24, 18, 3),
    1.45vw 1.45vw 0 rgb(22, 17, 3),
    1.5vw 1.5vw 0 rgb(21, 16, 2),
    1.55vw 1.55vw 0 rgb(19, 15, 2),
    1.6vw 1.6vw 0 rgb(18, 14, 2),
    1.65vw 1.65vw 0 rgb(16, 12, 2),
    1.7vw 1.7vw 0 rgb(15, 11, 1),
    1.75vw 1.75vw 0 rgb(13, 10, 1),
    1.8vw 1.8vw 0 rgb(11, 9, 1),
    1.85vw 1.85vw 0 rgb(10, 7, 1),
    1.9vw 1.9vw 0 rgb(8, 6, 1),
    1.95vw 1.95vw 0 rgb(6, 5, 0),
    2vw 2vw 0 rgb(5, 4, 0),
    2.05vw 2.05vw 0 rgb(3, 2, 0),
    2.1vw 2.1vw 0 rgb(1, 1, 0),
    2.15vw 2.15vw 0 #000,
    2.2vw 2.2vw 0 #000;
}

.intro-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
}

.intro-text {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  opacity: 0;
}

.intro-logo {
  width: clamp(150px, 20vw, 300px);
  margin: 1vh 0;
  opacity: 0;
  filter: brightness(0) invert(1);
}

.intro-year {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 700;
  opacity: 0;
}

/* ==================== Finale Scene ==================== */

.finale-actions {
  margin-top: 2rem;
  opacity: 0;
  width: 100%;
}

.finale-actions .replay-btn {
  width: 100%;
  justify-content: center;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid var(--white);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn svg {
  width: 1.25em;
  height: 1.25em;
}

.action-btn:hover {
  background: var(--white);
  color: var(--black);
}

.action-btn.primary {
  background: var(--white);
  color: var(--black);
}

.action-btn.primary:hover {
  background: transparent;
  color: var(--white);
}

.finale-gallery {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  margin: 1rem 0;
  opacity: 0;
}

.finale-right .screenshot-grid {
  max-width: 100%;
  grid-template-columns: repeat(3, 1fr);
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  width: 100%;
  max-width: 40vw;
}

.screenshot-item {
  aspect-ratio: 1200/628; /* Full screenshot with footer */
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
}

.screenshot-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Mobile finale - full-width scrollable screenshots */
@media (max-width: 600px) {
  .scene-finale .content {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .scene-finale .text-pane {
    flex-shrink: 0;
    padding: 2rem 1rem 1rem;
  }

  .scene-finale .chart-pane {
    flex: 1;
    overflow: visible;
  }

  .finale-gallery {
    display: block;
    width: 100%;
    padding: 0 1rem 2rem;
  }

  .screenshot-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 100%;
  }

  .screenshot-item {
    width: 100%;
    aspect-ratio: 1200/628;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  }
}

/* ==================== Progress & Controls ==================== */

/* ==================== Navigation Dots ==================== */

#navDots {
  position: fixed;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

body.playing #navDots {
  opacity: 1;
  pointer-events: auto;
}

.nav-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
  padding: 0;
}

.nav-dot:hover {
  background: rgba(255, 255, 255, 0.6);
}

.nav-dot.active {
  background: #fff;
}

/* Mobile: smaller dots, tighter spacing */
@media (max-width: 600px) {
  #navDots {
    right: 0.5rem;
    gap: 0.35rem;
  }

  .nav-dot {
    width: 8px;
    height: 8px;
  }
}

#progress {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  z-index: 100;
}

#progressBar {
  height: 100%;
  width: 0%;
  background: var(--white);
  transition: width 0.1s linear;
}

#controls {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50px;
  opacity: 0;
  transition: opacity 0.3s;
}

body.playing #controls { opacity: 1; }

.ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
}

.ctrl-btn svg {
  width: 24px;
  height: 24px;
}

#time {
  font-size: 0.9rem;
  color: var(--white-dim);
  min-width: 80px;
  text-align: center;
}

.hidden { display: none !important; }

/* ==================== Summary Overlay ==================== */

#summary {
  background: rgba(0, 0, 0, 0.95);
  overflow-y: auto;
}

.summary-content {
  text-align: center;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.summary-content h1 {
  font-size: clamp(2rem, 8vw, 5rem);
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.summary-content p {
  font-size: 1.25rem;
  color: var(--white-dim);
  margin-bottom: 2rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.summary-item {
  aspect-ratio: 1200/518; /* Content area only, no footer */
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
}

.summary-item:hover {
  transform: scale(1.02);
}

.summary-item img {
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: top; /* Crop from bottom to hide footer */
}

.summary-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ==================== Charts ==================== */

.chart-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.chart-container svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  overflow: visible;
}

/* ==================== Scene Gradients ==================== */

.scene:nth-child(1) .scene-bg { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.scene:nth-child(2) .scene-bg { background: linear-gradient(225deg, #ff6b6b 0%, #ee5a6f 50%, #c44569 100%); }
.scene:nth-child(3) .scene-bg { background: linear-gradient(45deg, #0f2027 0%, #203a43 50%, #2c5364 100%); }
.scene:nth-child(4) .scene-bg { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.scene:nth-child(5) .scene-bg { background: linear-gradient(270deg, #fa709a 0%, #ff9a8b 100%); }
.scene:nth-child(6) .scene-bg { background: linear-gradient(180deg, #a18cd1 0%, #fbc2eb 100%); }
.scene:nth-child(7) .scene-bg { background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 50%, #ffd1ff 100%); }
.scene:nth-child(8) .scene-bg { background: linear-gradient(90deg, #ffecd2 0%, #fcb69f 100%); }
.scene:nth-child(9) .scene-bg { background: linear-gradient(225deg, #e0c3fc 0%, #8ec5fc 100%); }
.scene:nth-child(10) .scene-bg { background: linear-gradient(315deg, #a8edea 0%, #fed6e3 50%, #ff9a9e 100%); }
.scene:nth-child(11) .scene-bg { background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e22ce 100%); }
.scene:nth-child(12) .scene-bg { background: linear-gradient(45deg, #ee9ca7 0%, #ffdde1 100%); }
.scene:nth-child(13) .scene-bg { background: linear-gradient(180deg, #0f2027 0%, #203a43 50%, #2c5364 100%); }
.scene:nth-child(14) .scene-bg { background: linear-gradient(270deg, #8e2de2 0%, #4a00e0 100%); }
.scene:nth-child(15) .scene-bg { background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%); }
.scene:nth-child(16) .scene-bg { background: linear-gradient(225deg, #fa8bff 0%, #2bd2ff 50%, #2bff88 100%); }
.scene-intro .scene-bg { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); }
.scene-finale .scene-bg { background: linear-gradient(180deg, rgba(0, 154, 222, 1) 0%, rgba(0, 0, 0, 1) 60%); }

/* Finale Layout - mirrors start page */
.finale-content {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  align-items: center !important;
  padding: 0 3vw !important;
}

.finale-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: visible;
  padding-right: 0.5vw;
  position: relative;
  z-index: 1;
  gap: 1vw;
}

/* Finale year - matches start-year styling */
.finale-year {
  font-size: 20vw;
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: -0.03em;
  color: #FFD700;
  opacity: 0;
  text-shadow:
    0.1vw 0.1vw 0 rgb(56, 42, 8),
    0.2vw 0.2vw 0 rgb(56, 42, 8),
    0.3vw 0.3vw 0 rgb(55, 41, 8),
    0.4vw 0.4vw 0 rgb(55, 41, 8),
    0.5vw 0.5vw 0 rgb(54, 41, 7),
    0.6vw 0.6vw 0 rgb(54, 40, 7),
    0.7vw 0.7vw 0 rgb(53, 40, 7),
    0.8vw 0.8vw 0 rgb(53, 40, 7),
    0.9vw 0.9vw 0 rgb(52, 39, 7),
    1.0vw 1.0vw 0 rgb(52, 39, 7),
    1.1vw 1.1vw 0 rgb(51, 38, 6),
    1.2vw 1.2vw 0 rgb(51, 38, 6),
    1.3vw 1.3vw 0 rgb(50, 38, 6),
    1.4vw 1.4vw 0 rgb(50, 37, 6),
    1.5vw 1.5vw 0 rgb(49, 37, 6),
    1.6vw 1.6vw 0 rgb(49, 36, 6),
    1.7vw 1.7vw 0 rgb(48, 36, 5),
    1.8vw 1.8vw 0 rgb(48, 36, 5),
    1.9vw 1.9vw 0 rgb(47, 35, 5),
    2.0vw 2.0vw 0 rgb(47, 35, 5),
    2.1vw 2.1vw 0 rgb(46, 35, 5),
    2.2vw 2.2vw 0 rgb(46, 34, 5),
    2.3vw 2.3vw 0 rgb(45, 34, 5),
    2.4vw 2.4vw 0 rgb(45, 33, 5),
    2.5vw 2.5vw 0 rgb(44, 33, 4),
    2.6vw 2.6vw 0 rgb(44, 33, 4),
    2.7vw 2.7vw 0 rgb(43, 32, 4),
    2.8vw 2.8vw 0 rgb(43, 32, 4),
    2.9vw 2.9vw 0 rgb(42, 31, 4),
    3.0vw 3.0vw 0 rgb(42, 31, 4),
    3.1vw 3.1vw 0 rgb(41, 31, 4),
    3.2vw 3.2vw 0 rgb(41, 30, 4),
    3.3vw 3.3vw 0 rgb(40, 30, 3),
    3.4vw 3.4vw 0 rgb(40, 30, 3),
    3.5vw 3.5vw 0 rgb(39, 29, 3),
    3.6vw 3.6vw 0 rgb(39, 29, 3),
    3.7vw 3.7vw 0 rgb(38, 28, 3),
    3.8vw 3.8vw 0 rgb(38, 28, 3),
    3.9vw 3.9vw 0 rgb(37, 28, 3),
    4.0vw 4.0vw 0 rgb(37, 27, 3),
    4.1vw 4.1vw 0 rgb(36, 27, 3),
    4.2vw 4.2vw 0 rgb(36, 27, 2),
    4.3vw 4.3vw 0 rgb(35, 26, 2),
    4.4vw 4.4vw 0 rgb(34, 26, 2),
    4.5vw 4.5vw 0 rgb(33, 25, 2),
    4.6vw 4.6vw 0 rgb(32, 24, 2),
    4.7vw 4.7vw 0 rgb(31, 24, 2),
    4.8vw 4.8vw 0 rgb(30, 23, 2),
    4.9vw 4.9vw 0 rgb(29, 22, 1),
    5.0vw 5.0vw 0 rgb(28, 21, 1),
    5.1vw 5.1vw 0 rgb(27, 20, 1),
    5.2vw 5.2vw 0 rgb(25, 19, 1),
    5.3vw 5.3vw 0 rgb(24, 18, 1),
    5.4vw 5.4vw 0 rgb(22, 17, 1),
    5.5vw 5.5vw 0 rgb(20, 15, 0),
    5.6vw 5.6vw 0 rgb(18, 14, 0),
    5.7vw 5.7vw 0 rgb(15, 12, 0),
    5.8vw 5.8vw 0 rgb(12, 9, 0),
    5.9vw 5.9vw 0 rgb(8, 6, 0),
    6.0vw 6.0vw 0 rgb(4, 3, 0),
    6.1vw 6.1vw 0 #000,
    6.2vw 6.2vw 0 #000;
}

.finale-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  padding-left: 0.5vw;
  padding-right: 1vw;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

/* Finale logo - matches start-logo styling */
.finale-logo {
  display: block;
  width: 80%;
  max-width: 350px;
  height: auto;
  margin-bottom: 1vw;
  filter: drop-shadow(0.15vw 0.15vw 0.1vw rgba(0, 0, 0, 0.5));
  opacity: 0;
}

.finale-title {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0;
  opacity: 0;
}

.finale-subtitle {
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 500;
  opacity: 0;
  margin: 0;
  color: var(--white-dim);
}

/* Finale Feedback Link */
.finale-feedback-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
  opacity: 0;
}

.finale-feedback-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

.finale-feedback-link svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Light text for dark backgrounds */
.scene:nth-child(1), .scene:nth-child(2), .scene:nth-child(3),
.scene:nth-child(11), .scene:nth-child(13), .scene:nth-child(14),
.scene:nth-child(15),
.scene-intro, .scene-finale {
  color: var(--white);
}

/* Dark text for light backgrounds */
.scene:nth-child(4), .scene:nth-child(5), .scene:nth-child(6),
.scene:nth-child(7), .scene:nth-child(8), .scene:nth-child(9),
.scene:nth-child(10), .scene:nth-child(12), .scene:nth-child(16) {
  color: var(--black);
}

.scene:nth-child(4) .subtitle, .scene:nth-child(5) .subtitle,
.scene:nth-child(6) .subtitle, .scene:nth-child(7) .subtitle,
.scene:nth-child(8) .subtitle, .scene:nth-child(9) .subtitle,
.scene:nth-child(10) .subtitle, .scene:nth-child(12) .subtitle,
.scene:nth-child(16) .subtitle {
  color: var(--black-dim);
}

/* Scene icons - dark for light backgrounds */
.scene:nth-child(4) .scene-icon, .scene:nth-child(5) .scene-icon,
.scene:nth-child(6) .scene-icon, .scene:nth-child(7) .scene-icon,
.scene:nth-child(8) .scene-icon, .scene:nth-child(9) .scene-icon,
.scene:nth-child(10) .scene-icon, .scene:nth-child(12) .scene-icon,
.scene:nth-child(16) .scene-icon {
  color: var(--black);
  opacity: 0.12;
}

/* Title elements - dark for light backgrounds */
.scene:nth-child(4) .title-start, .scene:nth-child(5) .title-start,
.scene:nth-child(6) .title-start, .scene:nth-child(7) .title-start,
.scene:nth-child(8) .title-start, .scene:nth-child(9) .title-start,
.scene:nth-child(10) .title-start, .scene:nth-child(12) .title-start,
.scene:nth-child(16) .title-start,
.scene:nth-child(4) .title-end, .scene:nth-child(5) .title-end,
.scene:nth-child(6) .title-end, .scene:nth-child(7) .title-end,
.scene:nth-child(8) .title-end, .scene:nth-child(9) .title-end,
.scene:nth-child(10) .title-end, .scene:nth-child(12) .title-end,
.scene:nth-child(16) .title-end {
  color: var(--black-dim);
}

/* ==================== Responsive ==================== */

/* Start screen switches to vertical layout earlier */
@media (max-width: 900px) {
  .start-panels {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3vh;
  }

  .start-left,
  .start-right {
    width: 100%;
    align-items: center;
    text-align: center;
    padding: 0;
  }

  .start-logo {
    width: 70vw;
    max-width: 500px;
  }

  .start-title {
    width: 85vw;
    max-width: 600px;
    font-size: 15vw;
  }

  .start-year {
    font-size: 35vw;
    margin-bottom: -2vw;
  }

  .start-year-svg {
    width: 90vw;
    max-width: 100%;
  }

  /* Finale responsive */
  .finale-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 2vh;
    padding: 2vh 3vw !important;
  }

  .finale-left,
  .finale-right {
    width: 100%;
    align-items: center;
    text-align: center;
    padding: 0;
  }

  .finale-year {
    font-size: 18vw;
  }

  .finale-logo {
    width: 50%;
    max-width: 200px;
  }

  .finale-title {
    font-size: 6vw;
  }

  .finale-subtitle {
    font-size: 3.5vw;
  }

  .finale-gallery {
    justify-content: center;
  }

  .screenshot-grid {
    max-width: 90vw;
  }

  .start-btn {
    width: 85vw;
    height: 15vw;
    font-size: 5vw;
    border-radius: 8vw;
  }

  .start-subtitle {
    font-size: 5vw;
    margin-top: 4vw;
  }
}

@media (max-width: 900px) {
  .content {
    grid-template: 1fr 1.5fr / 1fr;
    padding: 16vh 4vw 14vh; /* Top padding for larger header, bottom for footer */
  }

  .text-pane {
    align-items: center;
    text-align: center;
    justify-content: flex-end;
  }

  .title {
    justify-content: center;
  }

  .title-start {
    text-align: center;
  }

  .chart-pane {
    justify-content: center;
    align-items: flex-start;
  }

  .scene-icon {
    font-size: 60vw;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
  }

  .scene-intro .content {
    grid-template: 1fr 1fr / 1fr;
  }

  .intro-left, .intro-right {
    align-items: center;
    text-align: center;
    padding: 0;
  }

  .intro-text,
  .intro-year {
    font-size: 6vw;
  }

  .intro-logo {
    width: 60vw;
    max-width: 400px;
  }

  .screenshot-grid {
    max-width: 80vw;
  }

  .logo img { width: 200px; }
}

@media (max-width: 480px) {
  #header { padding: 1rem 1.5rem; }
  .logo img { width: 120px; }

  .content {
    grid-template: 1fr 2fr / 1fr;
    padding: 14vh 12vw 12vh; /* 2x horizontal padding on mobile */
  }

  .intro-content {
    padding: 0 12vw;
  }

  .title .value {
    font-size: clamp(2.5rem, 14vw, 8rem);
  }

  .screenshot-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==================== Reduced Motion ==================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .scene {
    opacity: 1 !important;
  }

  .summary-item:hover {
    transform: none;
  }

  /* Disable GSAP animations via CSS where possible */
  [style*="opacity"] {
    opacity: 1 !important;
  }
}

/* ==================== Achievement Badges ==================== */

/* Tier Colors */
.gold { --tier-bg: linear-gradient(135deg, #FFD700, #DAA520); --tier-border: #B8860B; --tier-text: #5D4E0B; --tier-dot: #FFD700; }
.silver { --tier-bg: linear-gradient(135deg, #E8E8E8, #A8A8A8); --tier-border: #808080; --tier-text: #404040; --tier-dot: #C0C0C0; }
.bronze { --tier-bg: linear-gradient(135deg, #E67E22, #CD7F32); --tier-border: #8B4513; --tier-text: #4A2600; --tier-dot: #CD7F32; }

/* Inline Badge (on regular scenes) - container-relative sizing */
.achievement-badge {
  margin-top: 5cqw;
}

.achievement-badge .metal-bar {
  width: 60cqw;
  max-width: 320px;
  height: 15cqw;
  max-height: 80px;
  padding: 0 3cqw;
  border-radius: 1.5cqw;
}

.achievement-badge .metal-bar .bar-icon {
  font-size: clamp(1.25rem, 5cqw, 2.5rem);
}

.achievement-badge .metal-bar .bar-title {
  font-size: clamp(0.75rem, 3cqw, 1.25rem);
}

.inline-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 24px;
  border: 2px solid;
  font-size: 0.8rem;
  font-weight: 700;
}

.inline-badge .badge-tier {
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.inline-badge .badge-title {
  color: var(--tier-text);
}

/* Achievements Scene */
.scene-achievements .content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.5rem;
}

.achievements-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.achievements-icon {
  font-size: 3rem;
  color: #FFD700;
  text-shadow:
    2px 2px 0 #000,
    3px 3px 0 #000,
    4px 4px 8px rgba(0, 0, 0, 0.5);
}

.achievements-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  max-width: 600px;
  padding: 1rem;
}

.achievement-mini {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: rgba(255,255,255,0.1);
  border-radius: 16px;
  font-size: 0.75rem;
  border: 1px solid rgba(255,255,255,0.1);
}

.achievement-mini .ach-tier-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tier-dot);
}

.achievement-mini .ach-title {
  color: rgba(255,255,255,0.9);
}

/* Master Achievement (Top 3) */
.master-achievement-container {
  margin-top: 1rem;
}

.master-achievement {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 3rem;
  border-radius: 16px;
  background: rgba(0,0,0,0.3);
  border: 2px solid;
  animation: masterPulse 2s ease-in-out infinite;
}

.master-achievement.emperor {
  border-color: #FFD700;
  box-shadow: 0 0 40px rgba(255,215,0,0.3);
}

.master-achievement.deity {
  border-color: #9B59B6;
  box-shadow: 0 0 40px rgba(155,89,182,0.3);
}

.master-achievement.machine {
  border-color: #3498DB;
  box-shadow: 0 0 40px rgba(52,152,219,0.3);
}

.master-glow {
  position: absolute;
  inset: -2px;
  border-radius: 16px;
  background: transparent;
  z-index: -1;
}

.master-achievement.emperor .master-glow { box-shadow: 0 0 60px rgba(255,215,0,0.4); }
.master-achievement.deity .master-glow { box-shadow: 0 0 60px rgba(155,89,182,0.4); }
.master-achievement.machine .master-glow { box-shadow: 0 0 60px rgba(52,152,219,0.4); }

.master-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.master-achievement.emperor .master-icon {
  color: #FFD700;
  text-shadow: 2px 2px 0 #000, 3px 3px 0 #000, 4px 4px 8px rgba(0,0,0,0.5);
}
.master-achievement.deity .master-icon {
  color: #9B59B6;
  text-shadow: 2px 2px 0 #000, 3px 3px 0 #000, 4px 4px 8px rgba(0,0,0,0.5);
}
.master-achievement.machine .master-icon {
  color: #3498DB;
  text-shadow: 2px 2px 0 #000, 3px 3px 0 #000, 4px 4px 8px rgba(0,0,0,0.5);
}

.master-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.master-subtitle {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  margin-top: 0.25rem;
  max-width: 300px;
  text-align: center;
}

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

/* Achievements Rank */
.achievements-rank {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.rank-label {
  color: rgba(255,255,255,0.5);
}

.rank-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #FFD700;
  text-shadow:
    2px 2px 0 #000,
    3px 3px 0 #000,
    4px 4px 8px rgba(0, 0, 0, 0.5);
}

.rank-total {
  color: rgba(255,255,255,0.5);
}

/* ==================== Achievement Hall (title-and-three-up) ==================== */

.scene-achievement-hall .content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.5rem;
  padding: 2rem;
  position: relative;
  overflow: visible;
}

/* Summary header with counter */
.hall-summary {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 800;
  line-height: 1.3;
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.3em;
}

.hall-prefix {
  color: #FFD700;
  text-shadow:
    2px 2px 0 #000,
    3px 3px 0 #000,
    4px 4px 8px rgba(0, 0, 0, 0.5);
}

.hall-counter {
  font-size: 1.4em;
  color: #FFD700;
  font-weight: 900;
  text-shadow:
    2px 2px 0 #000,
    3px 3px 0 #000,
    4px 4px 8px rgba(0, 0, 0, 0.5);
  font-variant-numeric: tabular-nums;
}

.hall-columns {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  width: 100%;
  max-width: 900px;
}

.hall-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.column-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: rgba(0,0,0,0.3);
}

.hall-column.gold .column-header { border-bottom: 2px solid #FFD700; }
.hall-column.silver .column-header { border-bottom: 2px solid #C0C0C0; }
.hall-column.bronze .column-header { border-bottom: 2px solid #CD7F32; }

.column-icon {
  width: 1.5rem;
  height: 1.5rem;
}
.hall-column.gold .column-icon { color: #FFD700; }
.hall-column.silver .column-icon { color: #C0C0C0; }
.hall-column.bronze .column-icon { color: #CD7F32; }

.column-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.column-badges {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  width: 100%;
}

.column-empty {
  color: rgba(255,255,255,0.3);
  font-size: 1.5rem;
  padding: 1rem;
}

/* Master achievement container */
.master-achievement-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
}

.master-achievement {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 2.5rem 2.5rem;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.85);
  border: 3px solid;
  min-width: 280px;
}

.master-achievement.emperor {
  border-color: #FFD700;
  box-shadow: 0 0 60px rgba(255, 215, 0, 0.5), inset 0 0 30px rgba(255, 215, 0, 0.1);
}

.master-achievement.deity {
  border-color: #9B59B6;
  box-shadow: 0 0 60px rgba(155, 89, 182, 0.5), inset 0 0 30px rgba(155, 89, 182, 0.1);
}

.master-achievement.machine {
  border-color: #3498DB;
  box-shadow: 0 0 60px rgba(52, 152, 219, 0.5), inset 0 0 30px rgba(52, 152, 219, 0.1);
}

.master-glow {
  position: absolute;
  inset: -20px;
  border-radius: 30px;
  background: radial-gradient(ellipse, var(--glow-color, rgba(255,215,0,0.2)) 0%, transparent 70%);
  pointer-events: none;
  animation: masterGlow 2s ease-in-out infinite;
}

.master-achievement.emperor .master-glow { --glow-color: rgba(255, 215, 0, 0.3); }
.master-achievement.deity .master-glow { --glow-color: rgba(155, 89, 182, 0.3); }
.master-achievement.machine .master-glow { --glow-color: rgba(52, 152, 219, 0.3); }

@keyframes masterGlow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.master-icon {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}

.master-achievement.emperor .master-icon {
  color: #FFD700;
  text-shadow: 2px 2px 0 #000, 3px 3px 0 #000, 4px 4px 8px rgba(0,0,0,0.5);
}
.master-achievement.deity .master-icon {
  color: #9B59B6;
  text-shadow: 2px 2px 0 #000, 3px 3px 0 #000, 4px 4px 8px rgba(0,0,0,0.5);
}
.master-achievement.machine .master-icon {
  color: #3498DB;
  text-shadow: 2px 2px 0 #000, 3px 3px 0 #000, 4px 4px 8px rgba(0,0,0,0.5);
}

.master-title {
  font-size: 1.5rem;
  font-weight: 900;
  text-align: center;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.master-achievement.emperor .master-title {
  color: #FFD700;
  text-shadow: 2px 2px 0 #000, 3px 3px 0 #000, 4px 4px 8px rgba(0,0,0,0.5);
}
.master-achievement.deity .master-title {
  color: #9B59B6;
  text-shadow: 2px 2px 0 #000, 3px 3px 0 #000, 4px 4px 8px rgba(0,0,0,0.5);
}
.master-achievement.machine .master-title {
  color: #3498DB;
  text-shadow: 2px 2px 0 #000, 3px 3px 0 #000, 4px 4px 8px rgba(0,0,0,0.5);
}

.master-subtitle {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  text-align: center;
  max-width: 280px;
}

/* Master crest container */
.master-crest {
  position: relative;
  width: 140px;
  height: 168px;
  margin-bottom: 1rem;
}

.master-crest .crest-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 12px var(--glow-color, rgba(255,215,0,0.4)));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.master-achievement.emperor .crest-svg {
  color: #B8860B;
  filter: drop-shadow(0 0 20px rgba(255,215,0,0.5));
}

.master-achievement.deity .crest-svg {
  color: #6C3483;
  filter: drop-shadow(0 0 20px rgba(155,89,182,0.5));
}

.master-achievement.machine .crest-svg {
  color: #1F618D;
  filter: drop-shadow(0 0 20px rgba(52,152,219,0.5));
}

.master-crest .master-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3.5rem;
  margin: 0;
}

/* Master rank badge at bottom */
.master-rank {
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.3rem 1.2rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 800;
  color: #000;
}

.master-achievement.emperor .master-rank {
  background: linear-gradient(135deg, #FFD700, #DAA520);
  box-shadow: 0 2px 8px rgba(255,215,0,0.4);
}

.master-achievement.deity .master-rank {
  background: linear-gradient(135deg, #9B59B6, #8E44AD);
  box-shadow: 0 2px 8px rgba(155,89,182,0.4);
  color: #fff;
}

.master-achievement.machine .master-rank {
  background: linear-gradient(135deg, #3498DB, #2980B9);
  box-shadow: 0 2px 8px rgba(52,152,219,0.4);
  color: #fff;
}

/* ==================== Metallic Bar Badges ==================== */

.metal-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  height: 44px;
  padding: 0 0.75rem;
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metal-bar:hover {
  transform: translateY(-1px) scale(1.02);
}

.metal-bar .bar-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255,255,255,0.15) 35%,
    rgba(255,255,255,0.3) 38%,
    rgba(255,255,255,0.15) 41%,
    transparent 60%
  );
  pointer-events: none;
}

.metal-bar .bar-icon {
  font-size: 1.25rem;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.metal-bar .bar-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.metal-bar .bar-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
  white-space: nowrap;
  transform-origin: left center;
}

/* Gold Bar */
.metal-bar.gold {
  background: linear-gradient(160deg, #FFF8DC 0%, #FFD700 15%, #DAA520 40%, #B8860B 60%, #DAA520 80%, #FFD700 95%, #FFF8DC 100%);
  box-shadow: 0 2px 8px rgba(184, 134, 11, 0.4), inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -1px 0 rgba(0,0,0,0.15);
  border: 1px solid #B8860B;
}
.metal-bar.gold .bar-icon,
.metal-bar.gold .bar-title { color: #5D4E0B; }

/* Silver Bar */
.metal-bar.silver {
  background: linear-gradient(160deg, #FFFFFF 0%, #E8E8E8 15%, #C0C0C0 40%, #A8A8A8 60%, #C0C0C0 80%, #E8E8E8 95%, #FFFFFF 100%);
  box-shadow: 0 2px 8px rgba(128, 128, 128, 0.4), inset 0 1px 0 rgba(255,255,255,0.6), inset 0 -1px 0 rgba(0,0,0,0.1);
  border: 1px solid #808080;
}
.metal-bar.silver .bar-icon,
.metal-bar.silver .bar-title { color: #404040; }

/* Bronze Bar */
.metal-bar.bronze {
  background: linear-gradient(160deg, #F5DEB3 0%, #E67E22 15%, #CD7F32 40%, #A0522D 60%, #CD7F32 80%, #E67E22 95%, #F5DEB3 100%);
  box-shadow: 0 2px 8px rgba(139, 69, 19, 0.4), inset 0 1px 0 rgba(255,255,255,0.3), inset 0 -1px 0 rgba(0,0,0,0.2);
  border: 1px solid #8B4513;
}
.metal-bar.bronze .bar-icon,
.metal-bar.bronze .bar-title { color: #4A2600; }

/* ==================== Accessibility ==================== */

/* Screen reader only - visually hidden but accessible */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus indicators for keyboard navigation */
.ctrl-btn:focus,
.nav-dot:focus,
.start-btn:focus,
.action-btn:focus,
.screenshot-item:focus {
  outline: 3px solid #FFD700;
  outline-offset: 3px;
}

.ctrl-btn:focus-visible,
.nav-dot:focus-visible,
.start-btn:focus-visible,
.action-btn:focus-visible,
.screenshot-item:focus-visible {
  outline: 3px solid #FFD700;
  outline-offset: 3px;
}

/* Hide outline for mouse clicks */
.ctrl-btn:focus:not(:focus-visible),
.nav-dot:focus:not(:focus-visible),
.start-btn:focus:not(:focus-visible),
.action-btn:focus:not(:focus-visible),
.screenshot-item:focus:not(:focus-visible) {
  outline: none;
}

/* Focus trap indicator for modals */
.summary:focus-within {
  box-shadow: inset 0 0 0 3px rgba(255, 215, 0, 0.3);
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: #FFD700;
  color: #000;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 700;
  z-index: 9999;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 1rem;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .ctrl-btn:focus,
  .nav-dot:focus,
  .start-btn:focus,
  .action-btn:focus {
    outline-width: 4px;
    outline-color: currentColor;
  }

  .nav-dot {
    border: 2px solid currentColor;
  }

  .title .value,
  .subtitle-value {
    text-shadow: none;
    -webkit-text-stroke: 1px currentColor;
  }
}

/* Touch target improvements for mobile */
@media (max-width: 768px) {
  .nav-dot {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-dot::before {
    content: '';
    width: 10px;
    height: 10px;
    background: inherit;
    border-radius: 50%;
  }

  .ctrl-btn {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Touch feedback for interactive elements */
@media (hover: none) {
  .screenshot-item:active,
  .ctrl-btn:active,
  .nav-dot:active,
  .action-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s;
  }
}
