/* Phone app. One column, one big button, nothing else competing with it. */

body { overflow-x: hidden; }

.aura {
  position: fixed;
  inset: -20vh -30vw auto;
  height: 70vh;
  background: radial-gradient(closest-side, rgba(212, 168, 75, .16), rgba(212, 168, 75, 0) 70%);
  pointer-events: none;
  z-index: 0;
  animation: breathe 11s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: .7; }
  50% { opacity: 1; }
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 460px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
}

.top { text-align: center; padding-top: 4px; }
.logo {
  display: block;
  width: min(46vw, 190px);
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .45));
}
.app-name {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ------------------------------------------------------------ setup */

.setup { margin-top: 20px; }
.step { padding: 22px 20px; display: grid; gap: 14px; }
.step h1 { font-family: var(--serif); font-size: 22px; line-height: 1.25; }
.lead { margin: -6px 0 0; color: var(--muted); }
.code-in { font-size: 26px; letter-spacing: .3em; text-align: center; font-weight: 700; }
.wide { width: 100%; }
.who-list { display: grid; gap: 12px; }
.who-btn {
  min-height: 64px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--navy-700);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 22px;
  cursor: pointer;
}
.who-btn:hover, .who-btn:focus-visible { border-color: var(--gold); background: var(--navy-600); }
#whoBack { justify-self: center; }

/* ------------------------------------------------------------- main */

.hero { text-align: center; margin-top: 14px; }
.hello { font-family: var(--serif); font-size: 24px; line-height: 1.2; }
.status { margin: 6px 0 0; color: var(--muted); font-size: 15px; min-height: 1.5em; }
.status.on { color: var(--ok); font-weight: 600; }

.timer {
  margin: 10px 0 16px;
  font-size: clamp(44px, 14vw, 60px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  line-height: 1;
  color: var(--ink-2);
  opacity: .45;
}
.timer.on { opacity: 1; color: var(--ink); }

.punch {
  --size: min(56vw, 31vh, 212px);
  position: relative;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  font-weight: 800;
  font-size: calc(var(--size) * .15);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--navy-900);
  background: radial-gradient(circle at 32% 28%, var(--gold-pale), var(--gold-p) 30%, var(--gold) 62%, #a87b2c);
  box-shadow: 0 0 0 6px rgba(212, 168, 75, .16), 0 14px 34px rgba(0, 0, 0, .5), inset 0 -6px 14px rgba(0, 0, 0, .18);
  transition: transform .12s ease, box-shadow .2s;
  touch-action: manipulation;
}
.punch:active { transform: scale(.97); }
.punch.stop {
  color: #fff;
  background: radial-gradient(circle at 32% 28%, #f09a9e, var(--stop-l) 34%, var(--stop) 66%, #7f2a31);
  box-shadow: 0 0 0 6px rgba(207, 90, 97, .18), 0 14px 34px rgba(0, 0, 0, .5), inset 0 -6px 14px rgba(0, 0, 0, .2);
}
/* While a shift runs, a slow ring leaves the button so "it's counting" is visible from across the room. */
.punch.stop::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(207, 90, 97, .55);
  animation: ring 2.8s ease-out infinite;
  pointer-events: none;
}
@keyframes ring {
  from { transform: scale(1); opacity: .9; }
  to { transform: scale(1.28); opacity: 0; }
}
.punch:disabled { cursor: wait; }

.hint { margin: 14px auto 0; max-width: 300px; font-size: 14px; color: var(--muted); min-height: 1.5em; }

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--navy-800);
  font-size: 14px;
}
.banner p { margin: 0; }
.banner.warn { border-color: rgba(242, 196, 107, .5); background: rgba(242, 196, 107, .1); color: var(--gold-pale); display: block; }

.auth { margin-top: 16px; padding: 14px; font-size: 14px; }
.auth p { margin: 0 0 10px; }
.auth-row { display: flex; gap: 10px; }
.auth-row .input { flex: 1; min-width: 0; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 22px;
}
.stat {
  display: grid;
  gap: 2px;
  padding: 12px 8px;
  text-align: center;
  border-radius: 12px;
  background: var(--navy-800);
  border: 1px solid var(--line-2);
}
.stat-k { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.stat-v { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }

.recent { margin-top: 24px; }
.recent h2 { font-family: var(--serif); font-size: 17px; margin-bottom: 8px; }
.shift-list { list-style: none; margin: 0; padding: 0; }
.shift-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line-2);
  font-size: 14px;
}
.shift-list .when { color: var(--ink-2); }
.shift-list .when small { display: block; color: var(--muted); font-size: 13px; }
.shift-list .dur { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.shift-list .tag { margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: .06em; }
.empty { color: var(--muted); font-size: 14px; margin: 4px 0 0; }

.foot { margin-top: 24px; display: grid; justify-items: center; gap: 4px; text-align: center; }
.sync { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.sync.ok .dot { background: var(--ok); }
.sync.wait .dot { background: var(--warn); }
.sync.bad .dot { background: #ff7a80; }
.sync.bad { color: #ffb3b6; }

/* ------------------------------------------------------ confirm sheet */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  align-items: end;
  background: rgba(5, 10, 20, .66);
  padding: 16px;
}
.sheet-card {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 22px 20px max(20px, env(safe-area-inset-bottom));
  border-radius: 18px;
  background: var(--navy-700);
  border: 1px solid var(--line);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .5);
}
.sheet-card h2 { font-family: var(--serif); font-size: 21px; }
.sheet-card p { color: var(--ink-2); margin: 8px 0 18px; }
.sheet-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 20;
  max-width: 428px;
  margin: 0 auto;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--gold-pale);
  color: var(--navy-900);
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}

@media (prefers-reduced-motion: reduce) {
  .aura, .punch.stop::after { animation: none; }
  .punch { transition: none; }
}
