/* Penny v14.48: the start page (who's playing, Play) and the Setup Penny panel (static/start-screen.js).
   It replaces the look of the old "Grown-up setup" form; the ids inside are the same, so app.js works as before. */

/* ---- the start page: Penny's meadow, a calm card in the middle ---- */
.grownup-setup.start-screen {
  padding: 18px; overflow-y: auto; place-items: start center;
  background:
    linear-gradient(180deg, rgba(7,18,36,.28) 0%, rgba(7,18,36,.55) 60%, rgba(7,18,36,.78) 100%),
    url("/static/meet-friends/meadow.jpg") center 70% / cover no-repeat, #0b1630;
  backdrop-filter: none;
}
.start-card {
  width: min(840px, 96vw); max-height: none; margin: auto; box-sizing: border-box;
  padding: 26px 28px 18px; border-radius: 30px; color: #eff6ff;
  background: linear-gradient(180deg, rgba(14,32,58,.86), rgba(8,22,42,.9));
  border: 1px solid rgba(255,255,255,.2); box-shadow: 0 30px 80px rgba(0,0,0,.4);
  backdrop-filter: blur(10px);
}
.start-brand { text-align: center; margin-bottom: 16px; }
.start-brand h1 {
  margin: 0; font-family: "Fredoka", "Nunito", "Segoe UI", sans-serif; font-weight: 700; font-size: clamp(34px, 5.2vw, 54px);
  line-height: 1.05; color: #fff6c9; text-shadow: 0 0 22px rgba(255,214,120,.45);
}
.start-tagline { margin: 6px 0 0; color: #d6e4f5; font-size: 16px; }
.start-card .meet-panel { margin: 0 0 18px; }

/* who's playing */
.start-player {
  display: grid; grid-template-columns: auto minmax(0, 1fr) 150px; gap: 12px; align-items: center;
  padding: 14px 16px; border-radius: 20px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14);
}
.start-label { font-family: "Fredoka", "Nunito", sans-serif; font-weight: 600; font-size: 19px; color: #ffd978; white-space: nowrap; }
.start-player input, .start-player select {
  width: 100%; box-sizing: border-box; border-radius: 14px; border: 1px solid rgba(255,255,255,.22); padding: 12px 14px;
  color: #fff; background: rgba(255,255,255,.1); outline: none; font: inherit; font-size: 18px; font-weight: 800;
}
.start-player select option { color: #18243a; }
.start-player input::placeholder { color: #9fb3ca; font-weight: 600; }
.start-player input:focus, .start-player select:focus { border-color: #ffd978; box-shadow: 0 0 0 3px rgba(255,217,120,.25); }
.start-hint { margin: 8px 4px 0; color: #b9cae0; font-size: 12.5px; line-height: 1.45; }

.start-status {
  margin: 14px 0 0; padding: 10px 14px; border-radius: 14px; font-weight: 700; line-height: 1.4;
  background: rgba(255,111,136,.14); border: 1px solid rgba(255,111,136,.6); color: #ffe0e5;
}
.start-status[hidden] { display: none; }
.start-play.setup-start {
  margin-top: 16px; padding: 16px 20px; border-radius: 20px; font-size: 22px; font-family: "Fredoka", "Nunito", sans-serif; font-weight: 700;
  color: #2b2450; background: linear-gradient(135deg, #ffe08a, #ffb8d0); box-shadow: 0 10px 26px rgba(255,184,208,.25);
  transition: transform .15s ease, box-shadow .15s ease;
}
.start-play.setup-start:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(255,184,208,.35); }
.start-play.setup-start:focus-visible { outline: 4px solid #fff; outline-offset: 3px; }
.start-footer { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.start-link {
  border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 9px 16px; cursor: pointer; font: inherit; font-weight: 800;
  color: #eff6ff; background: rgba(255,255,255,.08);
}
.start-link:hover, .start-link:focus-visible { background: rgba(255,255,255,.16); outline: none; border-color: #ffd978; }

/* ---- the Grown-ups panel: slides in from the right, on top of the start page ---- */
.gu-panel { position: fixed; inset: 0; z-index: 600; display: flex; justify-content: flex-end; background: rgba(4,10,22,.55); }
.gu-panel[hidden] { display: none; }
.gu-sheet {
  width: min(600px, 100%); height: 100%; display: flex; flex-direction: column; color: #eff6ff;
  background: linear-gradient(180deg, #10243f, #0a1a30); box-shadow: -20px 0 60px rgba(0,0,0,.4);
  animation: guIn .25s ease-out;
}
.gu-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.gu-head h2 { margin: 0; font-family: "Fredoka", "Nunito", sans-serif; font-weight: 700; font-size: 26px; }
.gu-head small { color: #b9cae0; font-size: 13px; }
.gu-close {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); cursor: pointer; font-size: 18px; font-weight: 900;
  color: #fff; background: rgba(255,255,255,.08);
}
.gu-close:hover, .gu-close:focus-visible { background: rgba(255,255,255,.18); outline: none; }
.gu-body { flex: 1; overflow-y: auto; padding: 16px 22px 28px; display: grid; gap: 14px; align-content: start; }
.gu-card {
  display: grid; gap: 12px; padding: 16px; border-radius: 20px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
}
.gu-card h3 { margin: 0; font-size: 18px; }
.gu-card .setup-status, .gu-card .setup-mic-check, .gu-card .setup-actions, .gu-card .camera-consent-row,
.gu-card .setup-camera-preview-wrap, .gu-card .setup-field { grid-column: auto; }
.gu-card .setup-memory { margin-top: 0; }
.gu-about { margin: 0; color: #c9d8ea; font-size: 13.5px; line-height: 1.45; }
.gu-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.gu-row b { display: block; }
.gu-row small { display: block; color: #b9cae0; font-size: 12.5px; line-height: 1.4; margin-top: 2px; }
.gu-card .setup-camera-preview-wrap { min-height: 200px; }
.gu-card #setupCameraPreview { height: 240px; }
.gu-advanced summary { cursor: pointer; font-weight: 800; font-size: 16px; }
.gu-advanced[open] summary { margin-bottom: 4px; }
.gu-advanced .setup-games { margin-top: 0; }
.gu-advanced .setup-footnote { margin: 0; }
.gu-advanced a { color: #9fd4f7; }

/* ---- Play stays locked until Penny is set up ---- */
.start-play.setup-start.is-locked {
  color: #e8eef8; background: rgba(255,255,255,.12); border: 2px dashed rgba(255,217,120,.7); box-shadow: none;
}
.start-ready { margin: 10px 4px 0; text-align: center; color: #ffe3a0; font-size: 14px; font-weight: 700; line-height: 1.45; }
.start-ready:empty { display: none; }
.start-ready.is-ready { color: #a6efc0; font-weight: 600; font-size: 13px; }

/* ---- Setup Penny: the four steps before the first game ---- */
.gu-checks { border-color: rgba(255,217,120,.45); background: rgba(255,217,120,.06); }
.gu-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.gu-step { border-radius: 16px; background: rgba(5,14,28,.45); border: 1px solid rgba(255,255,255,.12); overflow: hidden; }
.gu-step-head { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px 14px; }
.gu-step-head b { font-size: 16px; }
.gu-tick {
  width: 26px; height: 26px; border-radius: 50%; box-sizing: border-box; border: 2px solid rgba(255,255,255,.4);
  display: grid; place-items: center; font-size: 15px; font-weight: 900; color: #0d2a1a;
}
.gu-step-state { font-size: 12.5px; font-weight: 800; color: #ffd978; white-space: nowrap; }
.gu-step-body { display: grid; gap: 10px; padding: 0 14px 14px 52px; }
.gu-step-body .setup-status { min-height: 0; line-height: 1.45; }
.gu-step.is-done { border-color: rgba(140,240,174,.45); }
.gu-step.is-done .gu-tick { background: #8cf0ae; border-color: #8cf0ae; }
.gu-step.is-done .gu-tick::before { content: "✓"; }
.gu-step.is-done .gu-step-state { color: #8cf0ae; }
.gu-step.is-done .gu-step-head { cursor: pointer; }
.gu-step.is-done .gu-step-head:hover, .gu-step.is-done .gu-step-head:focus-visible { background: rgba(255,255,255,.05); outline: none; }
.gu-step.is-done .gu-step-state::after { content: " ▾"; }
.gu-step.is-folded .gu-step-state::after { content: " ▸"; }
.gu-step.is-folded .gu-step-body { display: none; }
.gu-yes { background: rgba(140,240,174,.18); border-color: rgba(140,240,174,.55); }

.gu-agreement {
  max-height: 260px; overflow-y: auto; padding: 12px 16px; border-radius: 12px; color: #1d2a3d; background: #f8fbff;
  font-size: 13.5px; line-height: 1.5;
}
.gu-agreement:focus-visible { outline: 3px solid #ffd978; outline-offset: 2px; }
.gu-agreement h1 { margin: 0 0 2px; font-size: 18px; }
.gu-agreement h2 { margin: 12px 0 4px; font-size: 14.5px; }
.gu-agreement p { margin: 6px 0; }
.gu-agreement .meta { margin: 0 0 8px; color: #5a6b82; font-size: 12px; }
.gu-agreement ul { margin: 4px 0; padding-left: 20px; }
.gu-agreement li { margin: 3px 0; }
.gu-print { color: #9fd4f7; font-size: 13px; justify-self: start; }
.gu-sign { display: grid; gap: 10px; }
.gu-sign[hidden] { display: none; }
.gu-check { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 14px; line-height: 1.4; cursor: pointer; }
.gu-check input { width: 18px; height: 18px; margin: 1px 0 0; }
.gu-sign button { justify-self: start; }
.gu-sign button:disabled { cursor: not-allowed; }
.gu-ready {
  display: grid; gap: 10px; padding: 14px; border-radius: 16px; text-align: center; font-weight: 800; color: #a6efc0;
  background: rgba(140,240,174,.1); border: 1px solid rgba(140,240,174,.45);
}
.gu-ready[hidden] { display: none; }
.gu-ready .setup-start { margin-top: 0; }
.gu-link {
  justify-self: start; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; font-size: 13px;
  color: #9fd4f7; text-decoration: underline;
}

@keyframes guIn { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }

@media (max-width: 620px) {
  .start-card { padding: 20px 16px 14px; border-radius: 24px; }
  .start-player { grid-template-columns: 1fr 120px; }
  .start-label { grid-column: 1 / -1; }
  .gu-row { grid-template-columns: 1fr; }
  .gu-step-body { padding-left: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .gu-sheet { animation: none; }
  .start-play.setup-start { transition: none; }
}
