@import url("./tokens.css");

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  overflow: hidden;
}

body {
  /* Atmósfera negra */
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.04) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 100%, rgba(0, 175, 236, 0.06) 0%, transparent 45%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.015) 2px,
      rgba(255, 255, 255, 0.015) 3px
    );
}

#app {
  width: 100%;
  height: 100%;
  max-width: 1080px;
  margin: 0 auto;
  position: relative;
}

.screen {
  display: none;
  flex-direction: column;
  height: 100%;
  padding: var(--pad);
  animation: fadeIn 0.25s ease;
}
.screen.active { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fest-logo {
  display: block;
  width: min(100%, 560px);
  height: auto;
  margin: 0 0 28px;
  align-self: flex-start;
}

.brand {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 72px;
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.brand span {
  display: block;
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--accent);
  font-size: 0.55em;
  letter-spacing: 0.12em;
  margin-top: 8px;
}

.eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.headline {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 80px;
  line-height: 1;
  text-transform: uppercase;
  margin: 16px 0;
}

.lead {
  font-size: 28px;
  line-height: 1.35;
  color: var(--ink-muted);
  max-width: 20em;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 40px 0;
}
.steps li {
  font-size: 26px;
  padding: 14px 0;
  border-top: 1px solid var(--hairline);
  display: flex;
  gap: 16px;
  align-items: baseline;
}
.steps li::before {
  content: attr(data-n);
  font-family: var(--font-body);
  font-weight: 900;
  color: var(--accent);
  font-size: 32px;
  min-width: 1.2em;
}

.btn {
  min-height: var(--touch-min);
  border: none;
  border-radius: 0;
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 40px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 24px 32px;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.05s, filter 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink-muted);
}
.btn-option {
  width: 100%;
  background: var(--bg-elev);
  color: var(--ink);
  border: 2px solid var(--hairline);
  text-align: left;
  font-size: 32px;
  line-height: 1.25;
  margin-bottom: 16px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.btn-option .opt-id {
  color: var(--accent);
  min-width: 1.4em;
}
.btn-option:active { border-color: var(--accent); }

.spacer { flex: 1; }

.pulse {
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* Tablero */
.turn-bar {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 56px;
  text-align: center;
  text-transform: uppercase;
  padding: 12px 0 24px;
}
.turn-bar .mark { color: var(--accent); }

.board {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: var(--board-gap);
  min-height: 0;
  max-height: 70vh;
}
.cell {
  background: var(--bg-elev);
  border: 3px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 96px;
  color: var(--ink-muted);
  min-height: var(--touch-min);
  cursor: pointer;
}
.cell.free:active { border-color: var(--accent); color: var(--accent); }
.cell.X { color: var(--x); border-color: var(--x); cursor: default; }
.cell.O { color: var(--o); border-color: var(--o); cursor: default; }
.cell.blocked {
  background: var(--blocked);
  color: #666;
  cursor: default;
}
.cell.win {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 4px var(--accent);
}

/* Caso */
.card-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 56px;
  text-transform: uppercase;
  line-height: 1.05;
  margin: 8px 0 20px;
}
.card-prompt {
  font-size: 40px;
  line-height: 1.3;
  margin-bottom: 28px;
  white-space: pre-line;
}
.ask {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 28px;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* Feedback */
.feedback-icon {
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 120px;
  line-height: 1;
  margin: 24px 0 8px;
}
.feedback-icon.ok { color: var(--ok); }
.feedback-icon.bad { color: var(--danger); }
.learning {
  font-size: 32px;
  line-height: 1.35;
  border-left: 4px solid var(--accent);
  padding-left: 20px;
  margin: 24px 0;
  color: var(--ink);
}
.answer-reveal {
  font-size: 28px;
  color: var(--ink-muted);
  margin-bottom: 12px;
}

/* Resultado final */
.result-screen {
  text-align: center;
  justify-content: center;
  align-items: center;
}
.result-screen .headline { font-size: 96px; }

.hidden { display: none !important; }

.btn-row {
  display: flex;
  gap: 16px;
  width: 100%;
}
.btn-half { flex: 1; }

.countdown {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 160px;
  line-height: 1;
  color: var(--accent);
  text-align: center;
  margin: 24px 0;
}

.mod-hint {
  font-size: 22px;
  color: var(--ink-muted);
  border: 1px dashed var(--hairline);
  padding: 16px;
  margin-top: 16px;
}
.mod-actions .btn-mod {
  flex: 1;
  min-height: 96px;
  font-size: 28px;
  background: var(--bg-elev);
  color: var(--ink-muted);
  border: 1px solid var(--hairline);
}

.cell.place-target {
  border-color: var(--accent);
  color: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}

.pin-display {
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 72px;
  letter-spacing: 0.3em;
  text-align: center;
  margin: 24px 0;
}
.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.pin-pad .btn {
  min-height: 100px;
  font-size: 48px;
  background: var(--bg-elev);
  color: var(--ink);
  border: 2px solid var(--hairline);
}

#mod-hotspot {
  position: fixed;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  z-index: 50;
}
