/* ================================================================
   INTIMACY DICE GAME - STYLESHEET
================================================================ */

/* ---------- THEME VARIABLES ---------- */
:root {
  --bg: #000;
  --fg: #fff;
  --muted: #ccc;
  --panel: #a9a9a9;
  --panel-border: rgba(255,255,255,.2);
  --btn-primary: #3dba61;
  --btn-muted: #e1e1e1;
  --radius: 12px;

  --level-warming:   #a8e0f8;
  --level-building:  #3dba61;
  --level-teasing:   #f9b136;
  --level-indulging: #f25030;
}

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

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

.app-header {
  text-align: center;
  margin: 0; /* remove default spacing */
  padding-top: 16px;
  padding-bottom: 8px;
}

.app-header h1 {
  margin: 0;
  padding: 0;
  font-size: 1.8rem;
  line-height: 1.2;
  letter-spacing: 1px;
}

/* Reduce vertical gap between header and panel */
.panel-container {
  margin-top: 12px;
  padding-top: 0;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  background-image: linear-gradient(to bottom, rgba(120, 7, 151, 0.77), rgb(245, 245, 245));
}

.app-header { text-align: center; margin-top: 10px; }

/* ---------- PANELS ---------- */
.panel-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 40px;
  padding: 40px 20px;
  min-height: calc(100vh - 80px);
}

.panel {
  background: var(--panel);
  border: 2px solid var(--panel-border);
  border-radius: 15px;
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.panel:not([hidden]) { opacity: 1; transform: scale(1); }
.panel[hidden] { display: none !important; }

/* ---- HEADINGS ---- */
h1, h2 {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 800;
  color: #fff;
  text-align: center;
  margin: 0;
}

/* Main title (app header) */
h1 {
  font-size: 1.8rem;
  margin-top: 20px;
  margin-bottom: 10px;
}

/* Section titles (setup, pause, etc.) */
h2 {
  font-size: 1.2rem;
  margin-bottom: 16px;
  color: #f5f5f5;
  opacity: 0.95;
}

/* ---------- LANDING PAGE ---------- */
#landingScreen {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 700px;
  margin: 60px auto;
  text-align: center;
  align-items: center;
}

#landingScreen .setup-title { 
  margin-bottom: 20px; 
}

#landingScreen .description {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 24px;
}

#landingScreen .landing-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
  align-items: center;
}

.landing-footer { 
  margin-top: 40px;
  font-size: 0.85rem;
  opacity: 0.8;
}

/* ---------- SETUP PANEL ---------- */
.setup { max-width: 520px; margin: 16px auto; }
.setup-title { margin-bottom: 0px; }

.description {
  padding: 10px;
  text-align: center;
}

.players {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.field input {
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
}

.modes {
  width: 100%;
  margin: 10px 0;
  border: 1px dashed #ffffff44;
  padding: 10px 12px;
  border-radius: 12px;
}

.radio {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 6px 0;
}

/* ---------- GAME PANEL ---------- */
.game {
  width: 100%;
  max-width: 520px;
  margin: 0 auto 20px;
  padding: 16px;
}

/* Top Info Bar */
.top-bar {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  text-align: center;
}

/* Player Row */
.player-name {
  font-weight: 700;
  color: #fff;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}
.player-name.active {
  color: #ff0202e5;
  animation: textGlow 2s ease-out;
}

.divider {
  opacity: 0.6;
  color: #ffffffaa;
}

@keyframes textGlow {
  0% { text-shadow: 0 0 0 rgba(255,255,255,0); }
  30% { text-shadow: 0 0 20px rgba(255,255,255,1); }
  100% { text-shadow: 0 0 0 rgba(255,255,255,0); }
}

/* Session Info */
.session-info {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  height: 28px;
  padding: 4px 10px;
  font-size: 0.85rem;
  border: 1px solid #ffffff33;
  border-radius: 999px;
}

.level-warming   { background: var(--level-warming); color: #fff; }
.level-building  { background: var(--level-building); color: #fff; }
.level-teasing   { background: var(--level-teasing); color: #fff; }
.level-indulging { background: var(--level-indulging); color: #fff; }

/* ---------- DICE ---------- */
.dice-container {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  justify-items: center;
}

.die {
  width: 120px;
  min-height: 100px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  color: #fff;
  text-align: center;
}

.die-action { background: #f5646c; }
.die-area   { background: #6da4d1; }

.die .label {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.die .emoji { font-size: 4.5rem; margin-bottom: 6px; }
.die .value { font-size: 1rem; opacity: .95; }

@keyframes spinEmoji {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.die.spinning .emoji { animation: spinEmoji 0.8s linear infinite; }

/* ---------- PROMPT BOX ---------- */
.prompt-box {
  width: 100%;
  margin-top: 28px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  color: #fff;
  min-height: 100px;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.prompt-title {
  font-weight: 800;
  margin-bottom: 6px;
  text-transform: uppercase;
  font-size: .85rem;
  color: #eaeaea;
  text-align: center;
}

.prompt-text { line-height: 1.35; margin-bottom: 6px; }

.prompt-enhancement {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 12px;
  visibility: visible;
}

.prompt-enhancement .label {
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: #eaeaea;
  margin-bottom: 4px;
}

.prompt-enhancement[hidden] {
  display: none !important;
  visibility: hidden !important;
}

@keyframes promptGlow {
  0%   { box-shadow: 0 0 0px rgba(255,255,255,0); }
  30%  { box-shadow: 0 0 20px rgb(255, 255, 255); }
  100% { box-shadow: 0 0 0px rgba(255,255,255,0); }
}
.prompt-box.glow { animation: promptGlow 1.4s ease-out; }

/* ---------- BUTTONS ---------- */
.button-group {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  margin-top: 14px;
}

.game-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-transform: uppercase;
  width: 220px;             /* ⬅ wider than text width */
  max-width: 90%;           /* responsive on mobile */
  padding: 10px 16px;
  margin: 6px;
  background-color: #333;
  color: white;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s ease, transform 0.1s ease; 
}

a.game-button {
  text-decoration: none; 
  font-weight: 700;
  padding: 10px 16px;
  font-size: 0.75rem;
  width: 150px;
  margin-top: 14px;
}

.button-group .game-button {
  width: 120px;
}

.primary { background: var(--btn-primary); color: #fff; }
.game-button:not(.primary) { background: var(--btn-muted); color: #000; }

/* ---------- STATUS BAR ---------- */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  font-weight: 600;
  color: #fff;
  font-size: 0.95rem;
}

/* ---------- PAUSE OVERLAY ---------- */
.pause-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  color: #fff;
  text-align: center;
  transition: opacity 0.3s ease;
}

.pause-overlay[hidden] { display: none; }

.pause-content {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 30px 40px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.pause-status {
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
  font-size: 0.95rem;
  opacity: 0.9;
}

.pause-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.pause-buttons .game-button {
  width: 180px;
  margin: 0 auto;
}

.pause-buttons .game-button:last-child {
  margin-top: 8px;
}

#setupScreen .game-button {
  margin-top: 8px;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 520px) {
  .button-group { grid-template-columns: 1fr 1fr; }
}

input, button {
  font-size: 16px; /* prevents zoom on iOS */
}

/* --- MOBILE OPTIMIZATIONS --- */
@media (max-width: 600px) {
  body {
    font-size: 16px;
    padding: 0 10px;
  }

    .app-header {
    padding-top: 10px;
    padding-bottom: 6px;
  }

  .panel-container {
    margin-top: 4px;
  }
}

  .app-header h1 {
    font-size: 1.3rem;
    line-height: 1.2;
    margin: 12px 0;
  }

  .panel {
    padding: 16px;
    margin: 12px 0;
    width: 100%;
  }

  .setup, .game, #landingScreen {
    width: 100%;
    max-width: 100%;
    padding: 16px;
  }

  .description {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .players {
    grid-template-columns: 1fr;
  }

  .modes legend {
    font-size: 1rem;
  }

  .radio span {
    font-size: 0.9rem;
  }

  /* Make all buttons easier to tap */
  .game-button {
    width: 100%;
    height: 56px;
    font-size: 1rem;
    margin-top: 6px;
  }

  #landingScreen #goToGameBtn {
  width: 100%;
  max-width: 520px; /* optional: prevents it from being huge on wide screens */
}

  /* Keep status bar text readable */
  .status-bar {
    display: flex;
    flex-direction: row !important;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; /* prevents overflow on very small screens */
    gap: 8px;
    text-align: center;
  }

  /* Make prompt box a bit more compact */
  .prompt-box {
    padding: 12px 14px;
    margin-top: 20px;
  }

  /* Fix footer spacing */
  .landing-footer {
    font-size: 0.8rem;
    text-align: center;
    margin-top: 20px;
  }