:root {
  --bg: #0f172a;
  --surface: #111827;
  --surface-2: #1f2937;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #60a5fa;
  --danger: #f87171;
  --border: rgba(148, 163, 184, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, sans-serif;
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.12), transparent 30%),
    linear-gradient(180deg, #020617 0%, #0f172a 100%);
  color: var(--text);
}

.page-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px;
}

header {
  margin-bottom: 24px;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 2.5vw, 3rem);
}

p {
  margin: 0;
  line-height: 1.7;
  color: var(--text-muted);
}

main {
  display: grid;
  gap: 24px;
  align-items: start;
}

.demo-area {
  position: relative;
}

.screen-shell {
  position: relative;
  min-height: 620px;
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(15,23,42,0.95), rgba(15,23,42,0.82));
  box-shadow: 0 28px 80px rgba(15,23,42,0.35);
}

.real-page,
.overlay {
  position: absolute;
  inset: 0;
}

.real-page {
  position: relative;
  background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.18), transparent 25%),
    linear-gradient(180deg, #111827 0%, #0f172a 100%);
  padding: 26px 0 140px;
  overflow: hidden;
}

.real-card {
  width: min(680px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px;
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.real-card h2 {
  margin-top: 0;
}

.real-card p {
  max-width: 680px;
  margin-bottom: 20px;
}

.hidden-actions {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 40px));
}

.hidden-actions button {
  width: 100%;
  padding: 18px 20px;
  border: none;
  border-radius: 18px;
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  background: linear-gradient(135deg, #38bdf8, #60a5fa);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.hidden-actions button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.status-box {
  padding: 16px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.12);
  margin-bottom: 18px;
  color: var(--text);
}

#camera-video {
  width: 100%;
  min-height: 250px;
  height: 250px;
  border-radius: 18px;
  background: #020617;
  object-fit: cover;
  display: block;
  visibility: hidden;
}

#camera-video.active {
  visibility: visible;
}

.camera-note {
  margin: 12px 0 18px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.overlay {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 1);
  pointer-events: auto;
}


.fake-card {
  width: min(640px, 100%);
  padding: 28px;
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02), 0 20px 80px rgba(0,0,0,0.18);
}

.title-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.badge-accent {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.16);
}

.fake-card h2 {
  margin-top: 0;
}

.hint {
  margin: 12px 0 24px;
  color: var(--text-muted);
}

.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.cell {
  min-height: 88px;
  border-radius: 18px;
  background: rgba(148, 163, 184, 0.08);
  display: grid;
  place-items: center;
  font-size: clamp(2rem, 2.5vw, 2.5rem);
  color: #e2e8f0;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08);
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.cell:hover {
  transform: translateY(-2px);
  background: rgba(56, 189, 248, 0.14);
  pointer-events: auto;
}

.cell.filled {
  cursor: default;
  color: #cbd5e1;
}

.game-status {
  margin-bottom: 16px;
  color: var(--text-muted);
}

.game-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.fake-button {
  min-height: 58px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(56,189,248,0.22), rgba(96,165,250,0.16));
  border: 1px solid rgba(56, 189, 248, 0.18);
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 700;
  color: #e2e8f0;
  cursor: pointer;
  pointer-events: auto;
}

.info-panel {
  padding: 24px;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.94);
  max-width: 360px;
}

.info-panel h3 {
  margin-top: 0;
}

.info-panel label {
  display: block;
  margin: 18px 0 8px;
  color: var(--text-muted);
}

input[type="range"] {
  width: 100%;
  accent-color: #38bdf8;
}

.opacity-value {
  margin-top: 10px;
  color: #cbd5e1;
}

.panel-note {
  margin-top: 20px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
}

@media (min-width: 900px) {
  main {
    grid-template-columns: 1.5fr 0.9fr;
  }
}

@media (max-width: 760px) {
  .screen-shell {
    min-height: auto;
  }

  .real-page {
    padding: 18px 0 120px;
  }

  .real-card {
    width: calc(100% - 24px);
    margin: 0 auto 24px;
    padding: 22px;
  }

  .hidden-actions {
    width: calc(100% - 48px);
    left: 50%;
    transform: translateX(-50%);
  }

  .overlay {
    padding: 18px;
  }

  .fake-card {
    padding: 20px;
  }

  .board {
    gap: 10px;
  }

  .cell {
    min-height: 76px;
    font-size: clamp(1.4rem, 4vw, 2rem);
  }

  .game-controls {
    grid-template-columns: 1fr;
  }

  .fake-button {
    min-height: 52px;
    font-size: 0.95rem;
  }

  .info-panel {
    max-width: 100%;
  }

  .real-actions {
    flex-direction: column;
  }
}
