:root {
  --bg-0: #12100d;
  --bg-1: #1a1712;
  --bg-2: #221d16;
  --border: #3a2f24;
  --text-primary: #ece6dc;
  --text-muted: #9a8a76;
  --accent-red: #d14430;
  --accent-red-dim: #82291c;
  --accent-gold: #d4a855;
  --danger: #e74c3c;
  --success: #7aaf5f;
  --font-mono: "JetBrains Mono", "Courier New", monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-pixel: "Handjet", "Press Start 2P", "Courier New", monospace;
  --font-pixel-ascii: "Press Start 2P", "Handjet", "Courier New", monospace;
  --font-pixel-body: "VT323", "Handjet", "Courier New", monospace;
}

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

body {
  background: var(--bg-0);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
}

#app { min-height: 100vh; display: flex; flex-direction: column; }

.screen {
  flex: 1;
  display: none;
  flex-direction: column;
  padding: 2rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.screen.active { display: flex; }

.title {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  letter-spacing: 0.15em;
  color: var(--accent-red);
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 2rem;
}

.btn {
  font-family: var(--font-mono);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: border-color 150ms, color 150ms;
}

.btn:hover { border-color: var(--accent-red); color: var(--accent-red); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.primary { border-color: var(--accent-red); color: var(--accent-red); }
.btn.primary:hover { background: var(--accent-red); color: var(--bg-0); }

.input {
  font-family: var(--font-mono);
  background: var(--bg-1);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  width: 100%;
}

.input:focus { outline: none; border-color: var(--accent-red); }

.hidden { display: none !important; }

.anasayfa-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  max-width: 400px;
  width: 100%;
  margin: 4rem auto 0;
}
.anasayfa-container .input { text-align: center; }
.anasayfa-actions { display: flex; flex-direction: column; gap: 1.5rem; width: 100%; }
.divider {
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
}
.join-row { display: flex; gap: 0.5rem; }
.join-row .input { flex: 1; text-transform: uppercase; }

.lobi-container { display: grid; gap: 2rem; max-width: 640px; width: 100%; margin: 0 auto; }
.lobi-code-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-1);
  border: 1px solid var(--border);
  padding: 1rem;
}
.label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.room-code {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  letter-spacing: 0.3em;
  color: var(--accent-gold);
  flex: 1;
}
.lobi-settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  background: var(--bg-1);
  border: 1px solid var(--border);
  padding: 1rem;
}
.section-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.players-list { list-style: none; }
.player-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-1);
  border-left: 2px solid var(--border);
  margin-bottom: 0.25rem;
}
.player-name { font-family: var(--font-mono); flex: 1; }
.player-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--accent-gold);
  text-transform: uppercase;
}
.lobi-actions { display: flex; justify-content: space-between; gap: 1rem; }
.lobi-actions .start-btn { flex: 1; }

.oyun-layout { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; flex: 1; }
@media (max-width: 900px) { .oyun-layout { grid-template-columns: 1fr; } }
.paragraph-box {
  background: var(--bg-1);
  border: 1px solid var(--border);
  padding: 1.5rem 2rem;
  height: calc(1.35rem * 1.8 * 3 + 3rem);
  min-height: 0;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  line-height: 1.8;
  letter-spacing: 0.05em;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: hidden;
  position: relative;
}
.paragraph-text {
  color: var(--text-muted);
  transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  position: relative;
}
.paragraph-text .char { position: relative; }
.paragraph-text .char.correct { color: var(--text-primary); }
.paragraph-text .char.incorrect { color: var(--danger); background: rgba(231, 76, 60, 0.15); }
.paragraph-text .char.current { background: var(--accent-red-dim); color: var(--text-primary); }
.paragraph-text.mistake-flash,
.paragraph-box.mistake-flash {
  animation: mistakeShake 220ms ease-in-out;
}
.paragraph-text.mistake-flash::before,
.paragraph-box.mistake-flash::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(209, 68, 48, 0.25);
  pointer-events: none;
  animation: mistakeFlash 220ms ease-out;
  border-radius: inherit;
  z-index: 1;
}
@keyframes mistakeShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}
@keyframes mistakeFlash {
  0%   { opacity: 0; }
  30%  { opacity: 1; }
  100% { opacity: 0; }
}
.self-status {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
  background: var(--bg-1);
  border: 1px solid var(--border);
  padding: 1rem;
}
.stat { display: flex; flex-direction: column; gap: 0.25rem; }
.stat-value { font-family: var(--font-mono); font-size: 1.25rem; color: var(--accent-gold); }
.rivals-panel {
  background: var(--bg-1);
  border: 1px solid var(--border);
  padding: 1rem;
  height: fit-content;
}
.rivals-list { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.rival-row { padding: 0.75rem; background: var(--bg-2); border-left: 2px solid var(--border); }
.rival-row.dead { opacity: 0.4; border-left-color: var(--danger); }
.rival-row.safe { border-left-color: var(--success); }
.rival-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.5rem; }
.rival-name { font-family: var(--font-mono); font-size: 0.95rem; }
.rival-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.rival-status.alive { color: var(--success); }
.rival-status.dead { color: var(--danger); }
.rival-status.safe { color: var(--accent-gold); }
.rival-bar { height: 4px; background: var(--bg-0); overflow: hidden; margin-bottom: 0.5rem; }
.rival-bar-fill { height: 100%; background: var(--accent-gold); transition: width 150ms; }
.rival-stats {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.roulette-overlay {
  position: absolute;
  inset: 0;
  background: rgba(18, 16, 13, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  pointer-events: none;
}
.roulette-content {
  text-align: center;
  font-family: var(--font-mono);
  background: var(--bg-1);
  border: 2px solid var(--accent-gold);
  padding: 1.5rem 2rem;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 168, 85, 0.3);
}
.roulette-prep {
  padding: 2rem 0 1.5rem;
}
.roulette-prep-label {
  color: var(--text-muted);
  letter-spacing: 0.3em;
  font-size: 0.85rem;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.roulette-prep-number {
  font-family: var(--font-mono);
  font-size: 5rem;
  line-height: 1;
  color: var(--accent-red);
  letter-spacing: 0.1em;
  animation: prep-pulse 1s infinite;
}
@keyframes prep-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.7; }
}

/* Target booth spotlight while its roulette is playing */
.arena-layout.roulette-active .booth:not(.is-target) {
  opacity: 0.35;
  filter: blur(1px);
  transition: opacity 250ms, filter 250ms;
}
.booth.is-target {
  box-shadow: 0 0 0 2px var(--accent-red), 0 0 40px rgba(196, 48, 43, 0.55);
  transform: scale(1.05);
  transition: transform 250ms, box-shadow 250ms;
  z-index: 5;
}
.roulette-title {
  font-size: 3rem;
  letter-spacing: 0.3em;
  color: var(--accent-red);
  margin-bottom: 1rem;
}
.roulette-subtitle {
  color: var(--text-muted);
  letter-spacing: 0.2em;
  margin-bottom: 2rem;
}
.roulette-result {
  font-size: 2rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  min-height: 3rem;
}
.roulette-result.survived { color: var(--success); }
.roulette-result.died { color: var(--danger); }

.izleyici-layout { display: grid; grid-template-columns: 1fr 360px; gap: 2rem; flex: 1; }
.rivals-panel.full { max-height: 70vh; overflow-y: auto; }
.chat-box {
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  border: 1px solid var(--border);
  padding: 1rem;
  max-height: 70vh;
}
.chat-messages {
  flex: 1;
  list-style: none;
  overflow-y: auto;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}
.chat-message { padding: 0.25rem 0; line-height: 1.4; }
.chat-message.system { color: var(--text-muted); font-style: italic; }
.chat-sender { color: var(--accent-gold); margin-right: 0.25rem; }
.chat-form { display: flex; gap: 0.5rem; }
.chat-form .input { flex: 1; }
.izleyici-actions { margin-top: 1rem; display: flex; justify-content: flex-end; }
.placeholder-text { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.85rem; padding: 1rem; }

.admin-login {
  max-width: 360px;
  margin: 4rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.admin-panel { display: flex; flex-direction: column; gap: 1.5rem; }
.admin-add-row {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 0.75rem;
  background: var(--bg-1);
  border: 1px solid var(--border);
  padding: 1rem;
  align-items: start;
}
.admin-add-row textarea.admin-text {
  min-height: 120px;
  resize: vertical;
  font-family: var(--font-mono);
  line-height: 1.6;
  padding: 0.75rem 1rem;
}
.admin-add-row .admin-add-btn { align-self: stretch; }
.paragraphs-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 60vh;
  overflow-y: auto;
}
.paragraph-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 1rem;
  align-items: start;
  background: var(--bg-1);
  border-left: 2px solid var(--border);
  padding: 0.85rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
}
.paragraph-lang { color: var(--accent-gold); letter-spacing: 0.2em; font-size: 0.75rem; padding-top: 0.15rem; }
.paragraph-text-row {
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.55;
  color: var(--text-primary);
}
.admin-actions { display: flex; gap: 1rem; }

.countdown-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 16, 13, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.countdown-content { text-align: center; font-family: var(--font-mono); }
.countdown-label {
  color: var(--text-muted);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}
.countdown-number {
  font-size: 8rem;
  color: var(--accent-gold);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.1em;
}
.countdown-number.go {
  color: var(--accent-red);
  font-size: 4rem;
  letter-spacing: 0.3em;
}

.lobi-notifications {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 50;
  pointer-events: none;
}
.lobi-notification {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent-gold);
  padding: 0.6rem 1rem;
  letter-spacing: 0.05em;
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 250ms, transform 250ms;
}
.lobi-notification.show {
  opacity: 1;
  transform: translateX(0);
}

.rival-row { display: flex; gap: 0.75rem; align-items: stretch; }
.rival-seat {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--accent-gold);
  background: var(--bg-0);
  border: 1px solid var(--border);
  min-width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.08em;
}
.rival-body { flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.rival-row.dead .rival-seat { color: var(--danger); }
.rival-row.safe .rival-seat { color: var(--accent-gold); }

.roulette-subject {
  font-family: var(--font-mono);
  color: var(--accent-gold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.revolver-container {
  width: 180px;
  height: 180px;
  margin: 0 auto 1.25rem;
  filter: drop-shadow(0 0 12px rgba(0, 0, 0, 0.6));
}
.revolver-svg { width: 100%; height: 100%; display: block; }
.revolver-outer {
  fill: var(--bg-0);
  stroke: var(--accent-gold);
  stroke-width: 3;
}
.revolver-ring {
  fill: none;
  stroke: var(--border);
  stroke-width: 2;
}
.revolver-chambers { transform-origin: 100px 100px; }
.revolver-chambers.spinning { animation: cylinder-spin 2.8s cubic-bezier(0.12, 0.75, 0.25, 1); }
.revolver-chambers.stopped { animation: none; }
.chamber { stroke: var(--border); stroke-width: 2; transition: filter 200ms; }
.chamber.empty { fill: var(--bg-2); }
.chamber.loaded { fill: var(--accent-red); }
.revolver-center { fill: var(--accent-gold); }

@keyframes cylinder-spin {
  0% { transform: rotate(0deg); }
  60% { transform: rotate(1440deg); }
  100% { transform: rotate(1680deg); }
}

.revolver-container.fired {
  animation: muzzle-flash 0.45s ease-out;
}
@keyframes muzzle-flash {
  0% { filter: brightness(1) drop-shadow(0 0 12px rgba(0, 0, 0, 0.6)); }
  15% { filter: brightness(3) drop-shadow(0 0 40px var(--accent-red)); }
  100% { filter: brightness(1) drop-shadow(0 0 12px rgba(0, 0, 0, 0.6)); }
}

.revolver-container.survived {
  animation: relief-pulse 0.45s ease-out;
}
@keyframes relief-pulse {
  0% { filter: brightness(1) drop-shadow(0 0 12px rgba(0, 0, 0, 0.6)); }
  35% { filter: brightness(1.3) drop-shadow(0 0 26px var(--accent-gold)); }
  100% { filter: brightness(1) drop-shadow(0 0 12px rgba(0, 0, 0, 0.6)); }
}

/* Pixel character core */
.character {
  width: 100%;
  height: 100%;
  shape-rendering: crispEdges;
  image-rendering: pixelated;
  display: block;
}
.char-shadow { fill: rgba(0, 0, 0, 0.35); }
.char-chair { fill: #2a1f16; }
.char-table { fill: var(--border); stroke: rgba(0, 0, 0, 0.3); stroke-width: 0.3; }
.char-typewriter { fill: #1a1a1a; }
.char-typewriter-top { fill: #3a3028; }
.char-body { fill: var(--char-shirt); }
.char-head { fill: var(--char-skin); }
.char-hair { fill: var(--char-hair); }
.char-eye { fill: #0a0a0a; }
.char-eye-x { fill: var(--danger); display: none; }
.char-arm { fill: var(--char-skin); }

.char-arm {
  transition: transform 90ms ease-out;
  transform-origin: 50% 100%;
}
/* Alternating keystroke: left arm strikes */
.character.key-left .char-arm-left {
  transform: translateY(-2.5px) translateX(0.5px);
}
.character.key-left .char-arm-right {
  transform: translateY(-0.5px);
}
/* Alternating keystroke: right arm strikes */
.character.key-right .char-arm-right {
  transform: translateY(-2.5px) translateX(-0.5px);
}
.character.key-right .char-arm-left {
  transform: translateY(-0.5px);
}
.character[data-state="paused"] .char-arm,
.character[data-state="dead"] .char-arm {
  transform: translateY(0) !important;
}
.character[data-state="dead"] .char-arm-left,
.character[data-state="dead"] .char-arm-right {
  transform: translateY(4px) !important;
}

/* Gun sprite — only visible during roulette */
.char-gun { opacity: 0; transition: opacity 120ms; }
.character[data-state="roulette"] .char-gun { opacity: 1; }
.gun-barrel { fill: #1a1a1a; }
.gun-sight { fill: #0a0a0a; }
.gun-cylinder { fill: #2a2a2a; }
.gun-chamber-dot { fill: #050505; }
.gun-hammer { fill: #0a0a0a; }
.gun-trigger-guard { fill: #1a1a1a; }
.gun-trigger { fill: #0a0a0a; }
.gun-grip { fill: #4a2818; }
.gun-grip-detail { fill: #2a1208; }

/* Mouth */
.char-mouth-closed { fill: #2a1510; }
.char-mouth-open { fill: #0a0a0a; display: none; }
.character[data-state="roulette"] .char-mouth-closed { display: none; }
.character[data-state="roulette"] .char-mouth-open { display: block; }
.character[data-state="dead"] .char-mouth-closed { display: none; }
.character[data-state="dead"] .char-mouth-open { display: block; fill: #3a0a00; }

/* Head shake during roulette for tension */
.character[data-state="roulette"] .char-head-group {
  animation: head-tremble 0.18s infinite;
  transform-origin: 24px 16px;
}
@keyframes head-tremble {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-0.3px); }
  75% { transform: translateX(0.3px); }
}

/* Muzzle flash — only briefly when dead */
.char-flash { opacity: 0; }
.character[data-state="dead"] .char-flash {
  animation: flash-once 0.3s forwards;
}
@keyframes flash-once {
  0% { opacity: 1; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}
.flash-core { fill: #ffd66b; }
.flash-ray { fill: #ffa030; }

/* Dead state: X-eyes, head slump, pale */
.character[data-state="dead"] .char-eye { display: none; }
.character[data-state="dead"] .char-eye-x { display: block; }
.character[data-state="dead"] .char-head-group {
  transform: rotate(20deg) translate(-4px, 4px);
  transform-origin: 24px 22px;
  transition: transform 0.6s ease-out;
}
.character[data-state="dead"] .char-arm-left,
.character[data-state="dead"] .char-arm-right {
  animation: none;
  transform: translateY(4px);
}
.character[data-state="dead"] { filter: saturate(0.4) brightness(0.7); }

/* Safe state: golden halo */
.char-halo { fill: var(--accent-gold); opacity: 0; }
.character[data-state="safe"] .char-halo {
  opacity: 0.6;
  animation: halo-pulse 1.8s ease-in-out infinite;
}
@keyframes halo-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* Booth container */
.booth {
  list-style: none;
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  transition: border-color 200ms, opacity 400ms;
}
.booth.dead { border-color: var(--danger); opacity: 0.6; }
.booth.safe { border-color: var(--accent-gold); }
.booth-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.booth-seat {
  color: var(--accent-gold);
  font-size: 1rem;
  letter-spacing: 0.1em;
}
.booth-status { color: var(--text-muted); }
.booth-status.alive { color: var(--success); }
.booth-status.dead { color: var(--danger); }
.booth-status.safe { color: var(--accent-gold); }
.booth-status.disconnected { color: var(--danger); }
.booth-char {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(to bottom, #0d0b08 0%, #1a1712 70%, #221d16 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
}
.booth-name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
  text-align: center;
}

/* Ghost panel in izleyici */
.ghost-panel {
  background: var(--bg-1);
  border: 1px solid var(--border);
  padding: 1rem;
  min-height: 70vh;
}
.ghost-stage {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.ghost-booth {
  position: relative;
  background: var(--bg-2);
  padding: 1rem;
  max-width: 260px;
  margin: 0 auto;
}
.ghost-booth .character {
  width: 180px;
  height: 180px;
  margin: 0 auto;
  display: block;
}
.ghost-name {
  text-align: center;
  font-family: var(--font-mono);
  color: var(--accent-gold);
  margin-top: 0.5rem;
  letter-spacing: 0.08em;
}
.character.ghost {
  filter: hue-rotate(180deg) brightness(1.4) opacity(0.85);
  animation: ghost-float 3s ease-in-out infinite;
}
@keyframes ghost-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* Speech bubble above ghost */
.speech-bubble {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translate(-50%, -100%) scale(0.8);
  background: var(--bg-0);
  border: 1px solid var(--accent-gold);
  padding: 0.5rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms, transform 200ms;
}
.speech-bubble.show {
  opacity: 1;
  transform: translate(-50%, -100%) scale(1);
}
.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--accent-gold);
}

/* ===== Arena / okey masası layout ===== */
.screen.arena-screen {
  max-width: none;
  padding: 1.25rem;
}

.arena-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(420px, 2fr) minmax(200px, 1fr);
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    ".    top    ."
    "left center right"
    ".    self   .";
  gap: 1.5rem;
  align-items: stretch;
}

.arena-slot {
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.arena-top { grid-area: top; }
.arena-left { grid-area: left; }
.arena-right { grid-area: right; }
.arena-self { grid-area: self; }

.arena-center {
  grid-area: center;
  display: flex;
  align-items: stretch;
  justify-content: center;
  position: relative;
}

.arena-center .paragraph-box {
  width: 100%;
  max-width: 820px;
  align-self: center;
  min-height: 0;
}

/* Arena booths share the base .booth styling; tweak for compact / wide variants */
.arena-top .booth,
.arena-left .booth,
.arena-right .booth {
  width: 220px;
  min-width: 200px;
}
.booth-self {
  width: 100%;
  max-width: 640px;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1rem;
  align-items: center;
}
.booth-self .booth-top,
.booth-self .booth-name,
.booth-self .rival-bar,
.booth-self .rival-stats {
  grid-column: 2;
}
.booth-self .booth-char {
  grid-column: 1;
  grid-row: 1 / span 4;
  aspect-ratio: 1;
  width: 150px;
  height: 150px;
}

/* Rotate/mirror opposite-seat characters so they face the table */
/* All arena characters face upright — no orientation flip */
/* self stays upright */

/* Responsive: on smaller screens stack linearly */
@media (max-width: 900px) {
  .arena-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "top"
      "left"
      "center"
      "right"
      "self";
  }
  .arena-top .booth,
  .arena-left .booth,
  .arena-right .booth,
  .booth-self { width: 100%; max-width: none; }
  .booth-self { grid-template-columns: 100px 1fr; }
  .booth-self .booth-char { width: 100px; height: 100px; }
}

.arena-timer {
  position: absolute;
  top: 1.5rem;
  left: 2rem;
  z-index: 15;
  font-family: var(--font-mono);
  font-size: 2rem;
  color: var(--accent-gold);
  padding: 0.5rem 1rem;
  letter-spacing: 0.15em;
  text-shadow: 0 0 12px rgba(212, 168, 85, 0.5);
  transition: color 300ms;
  background: rgba(18, 16, 13, 0.85);
  border: 2px solid var(--border);
}
.arena-screen { position: relative; }
.arena-timer.urgent {
  color: var(--accent-red);
  animation: timer-urgent 1s infinite;
}
@keyframes timer-urgent {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.rankings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 16, 13, 0.92);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.rankings-content {
  background: var(--bg-1);
  border: 2px solid var(--accent-gold);
  padding: 2.5rem 3rem;
  max-width: 1100px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  font-family: var(--font-mono);
  text-align: center;
  box-shadow: 0 0 80px rgba(212, 168, 85, 0.35);
}
.rankings-title {
  font-size: 2.25rem;
  letter-spacing: 0.3em;
  color: var(--accent-red);
  margin-bottom: 0.5rem;
}
.rankings-subtitle {
  color: var(--text-muted);
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.rankings-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  text-align: left;
}
.ranking-row,
.ranking-header {
  display: grid;
  grid-template-columns: 64px 1.4fr 120px 100px 110px 90px 120px 90px;
  gap: 1rem;
  padding: 0.75rem 1.1rem;
  background: var(--bg-2);
  border-left: 3px solid var(--border);
  align-items: center;
  font-size: 0.95rem;
}
.ranking-header {
  background: transparent;
  border-left-color: transparent;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.65rem;
  padding: 0.25rem 0.9rem;
}
.ranking-row:nth-child(1) { border-left-color: var(--accent-gold); }
.ranking-row:nth-child(2) { border-left-color: #b07850; }
.ranking-row:nth-child(3) { border-left-color: #8b4513; }
.ranking-row.is-me { background: rgba(212, 168, 85, 0.12); border-left-color: var(--accent-red); }
.ranking-row.ranking-dead { opacity: 0.65; }
.rank-pos { color: var(--accent-gold); font-size: 1.05rem; }
.rank-name { color: var(--text-primary); font-size: 0.9rem; }
.rank-status {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ranking-safe .rank-status { color: var(--success); }
.ranking-dead .rank-status { color: var(--danger); }
.ranking-disconnected .rank-status { color: var(--danger); }
.rank-stats {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: right;
}
.rank-cell {
  font-family: var(--font-mono);
  color: var(--text-primary);
  text-align: center;
  font-size: 0.8rem;
}
.status-safe { color: var(--success); }
.status-dead { color: var(--danger); }
.status-alive { color: var(--text-primary); }
.status-disconnected { color: var(--danger); }

.arena-slot.arena-top,
.arena-slot.arena-left,
.arena-slot.arena-right {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}
.arena-slot.arena-top { flex-direction: row; align-items: flex-start; overflow: visible; }
.arena-slot.arena-left,
.arena-slot.arena-right {
  flex-direction: column;
  align-items: stretch;
  max-height: 66vh;
  overflow-y: auto;
}

/* Compact mode: side slots use 2-column grid, balanced widths */
.arena-layout.compact {
  grid-template-columns: 240px minmax(0, 1fr) 240px;
}
.arena-layout.compact .arena-top {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.4rem;
  max-height: 28vh;
  overflow-y: auto;
}
.arena-layout.compact .arena-left,
.arena-layout.compact .arena-right {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: min-content;
  gap: 0.4rem;
  align-content: start;
  max-height: 76vh;
  overflow-y: auto;
}
.arena-layout.compact .arena-top .booth,
.arena-layout.compact .arena-left .booth,
.arena-layout.compact .arena-right .booth {
  width: auto;
  min-width: 0;
  padding: 0.4rem;
}
.arena-layout.compact .booth-name { font-size: 0.72rem; }
.arena-layout.compact .rival-stats { font-size: 0.62rem; }
.arena-layout.compact .booth-seat { font-size: 0.85rem; }
.arena-layout.compact .booth-char {
  width: 64px;
  height: 64px;
  aspect-ratio: auto;
  margin: 0 auto;
  padding: 2px;
}

/* Very compact mode: same grid but tighter */
.arena-layout.very-compact {
  grid-template-columns: 240px minmax(0, 1fr) 240px;
}
.arena-layout.very-compact .arena-top {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.3rem;
  max-height: 26vh;
  overflow-y: auto;
}
.arena-layout.very-compact .arena-left,
.arena-layout.very-compact .arena-right {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: min-content;
  gap: 0.3rem;
  align-content: start;
  max-height: 82vh;
  overflow-y: auto;
}
.arena-layout.very-compact .arena-top .booth,
.arena-layout.very-compact .arena-left .booth,
.arena-layout.very-compact .arena-right .booth {
  width: auto;
  min-width: 0;
  padding: 0.3rem;
  gap: 0.2rem;
}
.arena-layout.very-compact .booth-char {
  display: flex;
  width: 44px;
  height: 44px;
  aspect-ratio: auto;
  margin: 0 auto;
  padding: 0;
  background: none;
}
.arena-layout.very-compact .booth-name { font-size: 0.68rem; }
.arena-layout.very-compact .rival-stats { font-size: 0.55rem; }
.arena-layout.very-compact .booth-seat { font-size: 0.75rem; }
.arena-layout.very-compact .booth-status { font-size: 0.5rem; }

/* ===== Anasayfa — pixel hero ===== */
.screen.anasayfa-screen {
  max-width: none;
  padding: 0;
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at top, rgba(209, 68, 48, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse at bottom, rgba(212, 168, 85, 0.06) 0%, transparent 50%),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.015) 0 2px,
      transparent 2px 4px
    );
  pointer-events: none;
  z-index: 0;
}
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  gap: 2rem;
  max-width: 720px;
  margin: 0 auto;
}
.hero-brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.brand-tag {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  letter-spacing: 0.4em;
  color: var(--accent-gold);
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--accent-gold);
  background: rgba(212, 168, 85, 0.06);
}
.hero-title {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
  margin: 0.5rem 0;
}
.hero-title-line {
  font-family: var(--font-pixel);
  font-size: 3.25rem;
  line-height: 1;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  text-shadow:
    4px 4px 0 rgba(0, 0, 0, 0.6),
    0 0 24px rgba(209, 68, 48, 0.25);
}
.hero-title-line.accent {
  color: var(--accent-red);
  text-shadow:
    4px 4px 0 rgba(0, 0, 0, 0.6),
    0 0 40px rgba(209, 68, 48, 0.55);
  animation: title-glow 3.5s ease-in-out infinite;
}
@keyframes title-glow {
  0%, 100% { text-shadow: 4px 4px 0 rgba(0,0,0,0.6), 0 0 24px rgba(209, 68, 48, 0.35); }
  50% { text-shadow: 4px 4px 0 rgba(0,0,0,0.6), 0 0 52px rgba(209, 68, 48, 0.8); }
}
.hero-subtitle {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  letter-spacing: 0.5em;
  color: var(--text-muted);
  padding-left: 0.5em;
}

.hero-chars {
  display: flex;
  gap: 1.25rem;
  align-items: flex-end;
  justify-content: center;
  padding: 0.5rem;
}
.hero-char {
  width: 80px;
  height: 80px;
  shape-rendering: crispEdges;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.7));
  animation: hero-float 2.8s ease-in-out infinite;
}
.hero-char:nth-child(1) { animation-delay: 0s; }
.hero-char:nth-child(2) { animation-delay: 0.4s; }
.hero-char:nth-child(3) { animation-delay: 0.8s; }
@keyframes hero-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.hero-form {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: rgba(26, 23, 18, 0.7);
  border: 2px solid var(--border);
  padding: 1.5rem;
  position: relative;
}
.hero-form::before,
.hero-form::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent-gold);
}
.hero-form::before { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.hero-form::after { bottom: -2px; right: -2px; border-left: none; border-top: none; }

.hero-form .input {
  font-family: var(--font-pixel-body);
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  background: var(--bg-0);
  border: 2px solid var(--border);
  padding: 0.85rem 1rem;
  color: var(--text-primary);
  transition: border-color 150ms, box-shadow 150ms;
}
.hero-form .input::placeholder {
  color: var(--text-muted);
  letter-spacing: 0.06em;
}
.hero-form .input:focus {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 2px rgba(209, 68, 48, 0.18);
}
.hero-form .create-btn,
.hero-form .join-btn {
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  padding: 1rem 1.25rem;
  border: 2px solid var(--accent-red);
  color: var(--accent-red);
  background: rgba(209, 68, 48, 0.05);
  cursor: pointer;
  transition: background 150ms, color 150ms, transform 100ms;
}
.hero-form .create-btn:hover,
.hero-form .join-btn:hover {
  background: var(--accent-red);
  color: var(--bg-0);
  transform: translateY(-1px);
}
.hero-form .join-btn {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  background: rgba(212, 168, 85, 0.05);
}
.hero-form .join-btn:hover {
  background: var(--accent-gold);
  color: var(--bg-0);
}
.hero-form .join-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}
.hero-form .room-code-input {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-family: var(--font-pixel);
  font-size: 0.95rem;
}

.hero-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: center;
  margin: 0.25rem 0;
}
.hero-divider-line {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
}
.hero-divider-text {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  color: var(--text-muted);
}

.hero-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 0.5rem;
}
.footer-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-red);
}

/* Make titles & countdown pixel too */
.title,
.roulette-title,
.rankings-title,
.countdown-label,
.roulette-prep-label,
.roulette-subject {
  font-family: var(--font-pixel);
}
.arena-timer,
.roulette-prep-number,
.countdown-number,
.booth-seat,
.rank-pos {
  font-family: var(--font-pixel);
}

@media (max-width: 640px) {
  .hero-title-line { font-size: 2.2rem; }
  .brand-tag, .hero-subtitle { font-size: 0.5rem; }
  .hero-char { width: 60px; height: 60px; }
}

/* ===== Lobi — pixel hero ===== */
.screen.lobi-screen {
  max-width: none;
  padding: 0;
  position: relative;
  overflow: visible;
}
.lobi-frame {
  position: relative;
  z-index: 1;
  max-width: 1500px;
  width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  padding: 2.5rem 3rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.lobi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.lobi-brand {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.lobi-code-display {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(26, 23, 18, 0.9);
  border: 2px solid var(--border);
  padding: 0.75rem 1rem;
  position: relative;
}
.lobi-code-display::before,
.lobi-code-display::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid var(--accent-gold);
}
.lobi-code-display::before { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.lobi-code-display::after { bottom: -2px; right: -2px; border-left: none; border-top: none; }
.lobi-code-label {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  letter-spacing: 0.28em;
  color: var(--text-muted);
}
.lobi-room-code {
  font-family: var(--font-pixel);
  font-size: 1.35rem;
  letter-spacing: 0.3em;
  color: var(--accent-gold);
  text-shadow: 0 0 12px rgba(212, 168, 85, 0.5);
  padding: 0 0.5rem;
}
.lobi-copy-btn {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  letter-spacing: 0.18em;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: color 150ms, border-color 150ms;
}
.lobi-copy-btn:hover { color: var(--accent-gold); border-color: var(--accent-gold); }
.copy-icon { font-size: 0.85rem; }

.lobi-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1.1fr;
  gap: 1.5rem;
  flex: 1;
}
@media (max-width: 1200px) {
  .lobi-grid { grid-template-columns: 1fr 1fr; }
  .lobi-chat-panel { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .lobi-grid { grid-template-columns: 1fr; }
  .lobi-chat-panel { grid-column: auto; }
}

.lobi-chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.lobi-chat-panel .chat-messages {
  flex: 1;
  min-height: 200px;
  max-height: 48vh;
  overflow-y: auto;
  list-style: none;
  padding: 0.5rem 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.5;
}
.lobi-chat-panel .chat-form {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.lobi-panel {
  background: rgba(26, 23, 18, 0.75);
  border: 2px solid var(--border);
  padding: 2rem;
  position: relative;
}
.lobi-panel::before,
.lobi-panel::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid var(--accent-red);
}
.lobi-panel::before { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.lobi-panel::after { bottom: -2px; right: -2px; border-left: none; border-top: none; }

.lobi-panel-title {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: var(--accent-red);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.lobi-count {
  color: var(--accent-gold);
  font-size: 0.6rem;
}

.lobi-settings-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.lobi-setting {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.lobi-setting-label {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  letter-spacing: 0.28em;
  color: var(--text-muted);
}

/* Pixel custom select */
.pixel-select {
  position: relative;
  width: 100%;
}
.pixel-select-trigger {
  width: 100%;
  background: var(--bg-0);
  border: 2px solid var(--border);
  color: var(--text-primary);
  padding: 0.7rem 0.9rem;
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  transition: border-color 150ms, color 150ms;
}
.pixel-select-trigger:hover { border-color: var(--accent-gold); color: var(--accent-gold); }
.pixel-select.open .pixel-select-trigger { border-color: var(--accent-gold); color: var(--accent-gold); }
.pixel-select.disabled .pixel-select-trigger { opacity: 0.45; cursor: not-allowed; }
.pixel-select-arrow {
  color: var(--accent-gold);
  font-size: 0.75rem;
  transition: transform 150ms;
}
.pixel-select.open .pixel-select-arrow { transform: rotate(180deg); }

.pixel-select-menu {
  list-style: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-0);
  border: 2px solid var(--accent-gold);
  max-height: 240px;
  overflow-y: auto;
  z-index: 50;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 120ms, transform 120ms;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}
.pixel-select-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.pixel-select-item {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  padding: 0.65rem 0.9rem;
  color: var(--text-primary);
  cursor: pointer;
  border-bottom: 1px solid rgba(58, 47, 36, 0.5);
  transition: background 100ms, color 100ms;
}
.pixel-select-item:last-child { border-bottom: none; }
.pixel-select-item:hover { background: rgba(212, 168, 85, 0.12); color: var(--accent-gold); }
.pixel-select-item.active { color: var(--accent-gold); background: rgba(212, 168, 85, 0.08); }

/* Player cards grid */
.lobi-players-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem;
  max-height: 520px;
  overflow-y: auto;
}
.lobi-player-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-gold);
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  animation: card-in 200ms ease-out;
}
.lobi-player-card.is-owner { border-left-color: var(--accent-red); }
.lobi-player-seat {
  color: var(--accent-gold);
  font-size: 0.55rem;
}
.lobi-player-name {
  flex: 1;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lobi-player-badge {
  color: var(--accent-red);
  font-size: 0.5rem;
  letter-spacing: 0.15em;
}
.lobi-player-kick {
  margin-left: 0.25rem;
  padding: 0.15rem 0.4rem;
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  line-height: 1;
  background: transparent;
  color: var(--accent-red);
  border: 1px solid var(--accent-red);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.lobi-player-kick:hover {
  background: var(--accent-red);
  color: #fff;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Pixel buttons */
.pixel-btn {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  padding: 0.9rem 1.3rem;
  background: transparent;
  color: var(--text-muted);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: background 150ms, color 150ms, border-color 150ms, transform 100ms;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.pixel-btn:hover { border-color: var(--accent-gold); color: var(--accent-gold); transform: translateY(-1px); }
.pixel-btn.ghost { background: transparent; color: var(--text-muted); }
.pixel-btn.primary {
  color: var(--accent-red);
  border-color: var(--accent-red);
  background: rgba(209, 68, 48, 0.05);
}
.pixel-btn.primary:hover { background: var(--accent-red); color: var(--bg-0); border-color: var(--accent-red); }
.pixel-btn-arrow { font-size: 0.85rem; }

.lobi-footer {
  display: flex;
  justify-content: center;
  padding-top: 0.5rem;
}
.lobi-start-btn {
  padding: 1.2rem 2.5rem;
  font-size: 0.9rem;
}

/* Notifications (match pixel theme) */
.lobi-notification {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  color: var(--text-primary);
  background: var(--bg-1);
  border: 2px solid var(--border);
  border-left: 3px solid var(--accent-gold);
  padding: 0.6rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.notif-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-gold);
  animation: notif-pulse 1s infinite;
}
@keyframes notif-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Hero title stays in Press Start 2P (ASCII-only) */
.hero-title-line,
.hero-subtitle,
.brand-tag,
.hero-divider-text,
.hero-footer,
.footer-dot + span {
  font-family: var(--font-pixel-ascii);
}

/* Roulette title: smaller for Pixelify Sans, still impactful */
.roulette-title {
  font-size: 2.2rem;
  letter-spacing: 0.18em;
  line-height: 1;
}
.rankings-title {
  font-size: 1.75rem;
  letter-spacing: 0.22em;
}
.roulette-subject {
  font-size: 0.95rem;
  letter-spacing: 0.15em;
}
.roulette-prep-label {
  font-size: 1rem;
}
.roulette-prep-number {
  font-size: 4.5rem;
}
.arena-timer {
  font-size: 2.2rem;
  letter-spacing: 0.1em;
}
.countdown-label {
  font-size: 1rem;
  letter-spacing: 0.25em;
}
.countdown-number {
  font-size: 7rem;
}
.countdown-number.go {
  font-size: 3.5rem;
}
.rankings-subtitle {
  font-size: 0.85rem;
  letter-spacing: 0.2em;
}

/* ===== Readability pass: bump pixel font sizes + weight ===== */
.brand-tag {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  padding: 0.6rem 1.4rem;
}
.hero-subtitle {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.45em;
}
.hero-divider-text {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.25em;
}
.hero-footer {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.25em;
}
.hero-form .input {
  font-size: 1.35rem;
  letter-spacing: 0.05em;
}
.hero-form .create-btn,
.hero-form .join-btn {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  padding: 1.1rem 1.3rem;
}
.hero-form .room-code-input {
  font-size: 1.3rem;
  letter-spacing: 0.3em;
}

/* Lobi labels & cards */
.lobi-code-label {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.2em;
}
.lobi-room-code {
  font-size: 2rem;
  letter-spacing: 0.28em;
  font-weight: 700;
}
.lobi-copy-btn {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  padding: 0.55rem 0.9rem;
}
.lobi-panel-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.22em;
}
.lobi-count { font-size: 1rem; font-weight: 500; }
.lobi-setting-label {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.2em;
}
.pixel-select-trigger {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 1rem 1.2rem;
}
.pixel-select-arrow { font-size: 1.35rem; }
.pixel-select-item {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  padding: 0.9rem 1.15rem;
}
.lobi-player-card {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 0.7rem 0.85rem;
}
.lobi-player-seat { font-size: 0.9rem; font-weight: 700; }
.lobi-player-badge { font-size: 0.85rem; font-weight: 600; letter-spacing: 0.12em; }
.lobi-notification { font-size: 0.95rem; font-weight: 500; letter-spacing: 0.1em; }

/* Pixel buttons bump */
.pixel-btn {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.18em;
}
.lobi-start-btn { font-size: 1.3rem; letter-spacing: 0.22em; padding: 1.3rem 2.8rem; }

/* Game screen */
.booth-seat { font-size: 1.25rem; font-weight: 700; }
.booth-status { font-size: 0.95rem; font-weight: 500; letter-spacing: 0.15em; }
.booth-name { font-size: 1.1rem; font-weight: 600; letter-spacing: 0.05em; }
.rival-stats { font-size: 0.9rem; font-weight: 500; letter-spacing: 0.08em; }

.arena-timer { font-size: 3rem; font-weight: 700; letter-spacing: 0.15em; }
.roulette-title { font-size: 2.6rem; font-weight: 700; letter-spacing: 0.15em; }
.rankings-title { font-size: 2.2rem; font-weight: 700; letter-spacing: 0.2em; }
.roulette-subject { font-size: 1.2rem; font-weight: 600; letter-spacing: 0.1em; }
.roulette-prep-label { font-size: 1.2rem; font-weight: 500; letter-spacing: 0.28em; }
.roulette-prep-number { font-size: 5rem; font-weight: 700; }
.rankings-subtitle { font-size: 1rem; font-weight: 500; letter-spacing: 0.2em; }
.rank-pos { font-size: 1.3rem; font-weight: 700; }
.rank-name { font-size: 1.05rem; font-weight: 500; }
.rank-status { font-size: 0.85rem; font-weight: 500; letter-spacing: 0.1em; }
.rank-cell { font-size: 1rem; font-weight: 500; }
.ranking-header { font-size: 0.85rem; letter-spacing: 0.15em; }
.countdown-label { font-size: 1.2rem; font-weight: 500; letter-spacing: 0.25em; }
.countdown-number { font-size: 8rem; font-weight: 700; }
.countdown-number.go { font-size: 4rem; font-weight: 700; }

/* Compact booth text bumps (still smaller but readable) */
.arena-layout.compact .booth-name { font-size: 0.95rem; }
.arena-layout.compact .rival-stats { font-size: 0.8rem; }
.arena-layout.compact .booth-seat { font-size: 1.05rem; }
.arena-layout.compact .booth-status { font-size: 0.78rem; }
.arena-layout.very-compact .booth-name { font-size: 0.88rem; }
.arena-layout.very-compact .rival-stats { font-size: 0.72rem; }
.arena-layout.very-compact .booth-seat { font-size: 0.95rem; }
.arena-layout.very-compact .booth-status { font-size: 0.7rem; }

/* Numeric values back to mono for crystal clarity */
.arena-timer,
.rank-cell,
.rival-mistakes,
.rival-bullets {
  font-family: var(--font-mono);
}

.arena-timer.unlimited {
  color: var(--accent-gold);
  animation: none;
  font-size: 2.5rem;
  padding: 0.25rem 1.2rem;
}

.booth {
  position: relative;
}
.booth-roulette-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--accent-red);
  color: #fff;
  padding: 0.3rem 0.55rem;
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 0 12px rgba(209, 68, 48, 0.85), 0 0 24px rgba(209, 68, 48, 0.4);
  animation: badge-pulse 0.7s ease-in-out infinite;
  z-index: 10;
  pointer-events: none;
}
.booth-roulette-badge .badge-icon {
  font-size: 0.85rem;
  animation: badge-spin 1s linear infinite;
}
.booth-roulette-badge .badge-bullets {
  background: rgba(0, 0, 0, 0.3);
  padding: 0 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}
@keyframes badge-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 16px rgba(209, 68, 48, 0.75); }
  50% { transform: scale(1.05); box-shadow: 0 0 22px rgba(209, 68, 48, 1); }
}
@keyframes badge-spin {
  from { transform: rotate(0); }
  to { transform: rotate(360deg); }
}

.rankings-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.rankings-actions .pixel-btn {
  min-width: 200px;
}

/* ===== İzleyici (spectator) ===== */
.screen.izleyici-screen {
  max-width: none;
  padding: 2rem;
}
.izleyici-frame {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}
@media (max-width: 760px) {
  .izleyici-frame { grid-template-columns: 1fr; }
}
.ghost-panel {
  background: var(--bg-1);
  border: 2px solid var(--border);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}
.chat-box {
  background: var(--bg-1);
  border: 2px solid var(--border);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 480px;
}
.chat-messages {
  flex: 1;
  list-style: none;
  overflow-y: auto;
  padding: 0.5rem 0;
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1.5;
  max-height: 60vh;
}
.chat-message { padding: 0.3rem 0; }
.chat-message.system {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9rem;
}
.chat-sender { color: var(--accent-gold); font-weight: 700; margin-right: 0.35rem; }
.chat-text { color: var(--text-primary); }
.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.chat-form .input {
  font-family: var(--font-mono);
  padding: 0.75rem 1rem;
}
.chat-form .btn {
  font-family: var(--font-pixel);
  padding: 0.6rem 1.2rem;
  letter-spacing: 0.15em;
}

.ghost-booth {
  text-align: center;
}
.ghost-booth .character { width: 140px; height: 140px; }
.ghost-name {
  font-family: var(--font-pixel);
  color: var(--accent-gold);
  font-size: 1rem;
  margin-top: 0.5rem;
  letter-spacing: 0.15em;
}
.izleyici-status {
  font-family: var(--font-pixel);
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-align: center;
  margin-top: auto;
}
.izleyici-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.izleyici-screen .rankings-content {
  max-width: 1100px;
  margin: 1.5rem auto 0;
  background: var(--bg-1);
  border: 2px solid var(--accent-gold);
  padding: 2rem 2.5rem;
}

.izleyici-frame-v2 {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}
@media (max-width: 820px) {
  .izleyici-frame-v2 { grid-template-columns: 1fr; }
}
.izleyici-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}
.scoreboard-panel {
  background: var(--bg-1);
  border: 2px solid var(--border);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.scoreboard-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-height: 45vh;
  overflow-y: auto;
}
.scoreboard-row,
.scoreboard-header {
  display: grid;
  grid-template-columns: 50px 1.3fr 90px 60px 60px 60px 60px 60px;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-2);
  border-left: 3px solid var(--border);
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}
.scoreboard-header {
  background: transparent;
  border-left-color: transparent;
  color: var(--text-muted);
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
}
.scoreboard-row.is-me { background: rgba(212, 168, 85, 0.14); border-left-color: var(--accent-red); }
.scoreboard-row.ranking-safe { border-left-color: var(--accent-gold); }
.scoreboard-row.ranking-dead { border-left-color: var(--danger); opacity: 0.7; }
.scoreboard-row:nth-child(2) { border-left-color: var(--accent-gold); }
.scoreboard-row .rank-pos {
  font-family: var(--font-pixel);
  color: var(--accent-gold);
  font-size: 0.95rem;
}
.scoreboard-row .rank-name {
  font-family: var(--font-pixel);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.95rem;
}
.scoreboard-row .rank-cell {
  text-align: center;
  color: var(--text-primary);
}

.izleyici-screen .chat-box {
  min-height: 280px;
  max-height: 40vh;
}
.izleyici-screen .chat-messages { max-height: 28vh; }

.ghost-panel .izleyici-actions {
  margin-top: auto;
  width: 100%;
  flex-direction: column;
}
.ghost-panel .izleyici-actions .pixel-btn { width: 100%; }

/* === Modal === */
.kp-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 4, 2, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: kpModalFade 140ms ease-out;
}
@keyframes kpModalFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
body.kp-modal-open { overflow: hidden; }
.kp-modal-card {
  position: relative;
  background: #f4ecd4;
  color: #1a1a1a;
  border: 4px solid #1a1a1a;
  box-shadow:
    8px 8px 0 #1a1a1a,
    10px 10px 0 rgba(255, 210, 63, 0.85),
    0 0 60px rgba(255, 140, 40, 0.35);
  width: min(440px, 100%);
  padding: 0;
  animation: kpModalPop 180ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
  font-family: 'Handjet', 'VT323', system-ui, monospace;
}
@keyframes kpModalPop {
  from { transform: translateY(-12px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.kp-modal-stripe {
  height: 16px;
  background: repeating-linear-gradient(
    135deg,
    #ffd23f 0,
    #ffd23f 12px,
    #1a1a1a 12px,
    #1a1a1a 24px
  );
  border-bottom: 4px solid #1a1a1a;
}
.kp-modal-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 16px 22px 8px;
  color: #1a1a1a;
  margin: 0;
}
.kp-modal-message {
  font-size: 19px;
  line-height: 1.45;
  letter-spacing: 0.5px;
  padding: 14px 22px 22px;
  color: #1a1a1a;
  margin: 0;
}
.kp-modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 22px 22px;
  flex-wrap: wrap;
}
.kp-modal-btn {
  font-family: 'Press Start 2P', 'Handjet', monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 11px 18px;
  border: 3px solid #1a1a1a;
  background: #f4ecd4;
  color: #1a1a1a;
  cursor: pointer;
  box-shadow: 4px 4px 0 #1a1a1a;
  transition: transform 80ms ease, box-shadow 80ms ease;
}
.kp-modal-btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 #1a1a1a; }
.kp-modal-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #1a1a1a; }
.kp-modal-btn:focus-visible { outline: 3px solid #ffd23f; outline-offset: 2px; }
.kp-modal-btn-primary { background: #ffd23f; }
.kp-modal-btn-secondary { background: #f4ecd4; }
.kp-modal-btn-danger   { background: #d44a3f; color: #f4ecd4; }
.kp-modal-btn-warning  { background: #ed7a5a; color: #1a1a1a; }
