/* Strike a Pose Alarm Clock: styles */

:root {
  --bg: #f5f5f7;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --text: #1d1d1f;
  --text-soft: #6e6e73;
  --text-faint: #a1a1a6;
  --line: #e5e5ea;
  --accent: #ff6b35;
  --accent-deep: #d63d10;
  --primary: #007aff;
  --success: #34c759;
  --danger: #ff3b30;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 4px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
  --radius: 18px;
  --radius-lg: 24px;
}

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

html, body {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Baloo 2', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.6s ease;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
}

input {
  font-family: inherit;
}

a { color: inherit; text-decoration: none; }

/* ===== VIEW SWITCHING ===== */
.view {
  display: none;
  min-height: 100vh;
  width: 100%;
}
body.view-setup .view-setup-pane { display: block; }
body.view-running .view-running-pane { display: flex; }
body.view-alarm .view-alarm-pane { display: flex; }
body.view-defused .view-defused-pane { display: flex; }

/* =============================================================
   SETUP VIEW
   ============================================================= */
.view-setup-pane {
  padding: 48px 32px 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 36px;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero-title {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  background: linear-gradient(135deg, #1d1d1f 0%, #5a5a5e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-dot {
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
}

.hero-tag {
  font-size: clamp(15px, 1.5vw, 18px);
  color: var(--text-soft);
  margin-top: 8px;
  font-weight: 500;
}

@media (max-width: 720px) {
  .hero { flex-direction: column; align-items: stretch; text-align: center; }
  .hero-text { text-align: center; }
}

/* ===== Big connect board button (header) ===== */
.big-connect {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  background: linear-gradient(135deg, #007aff 0%, #0a4eb3 100%);
  color: white;
  border-radius: 18px;
  font-family: inherit;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.32), 0 2px 6px rgba(0, 122, 255, 0.18);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.3s;
  position: relative;
  flex-shrink: 0;
  text-align: left;
}

.big-connect:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 32px rgba(0, 122, 255, 0.42), 0 4px 10px rgba(0, 122, 255, 0.24);
}

.big-connect:active { transform: translateY(0); }

.big-connect-icon {
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.big-connect-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.big-connect-main {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.005em;
  line-height: 1.1;
}

.big-connect-sub {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.88;
  letter-spacing: 0.01em;
}

.big-connect.connected {
  background: linear-gradient(135deg, var(--success) 0%, #1ea645 100%);
  box-shadow: 0 6px 20px rgba(52, 199, 89, 0.32);
  animation: none !important;
}

.big-connect.connected .big-connect-sub::after {
  content: '';
}

/* Jiggle attention animation, infinite. JS removes class on connect. */
@keyframes jiggle {
  0%   { transform: rotate(0); }
  10%  { transform: rotate(-2.5deg); }
  20%  { transform: rotate(2.5deg); }
  30%  { transform: rotate(-2deg); }
  40%  { transform: rotate(2deg); }
  50%  { transform: rotate(-1deg); }
  60%  { transform: rotate(1deg); }
  100% { transform: rotate(0); }
}

button.jiggle {
  animation: jiggle 1.2s ease-in-out infinite;
  transform-origin: center;
}

button.jiggle:hover {
  /* Pause jiggle on hover so it's easier to click */
  animation-play-state: paused;
}

/* ===== Status strip (top of timer card) ===== */
.status-strip {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  border: 1px solid var(--line);
  flex: 1;
  min-width: 0;
}

.status-chip.ok {
  background: rgba(52, 199, 89, 0.1);
  color: var(--success);
  border-color: rgba(52, 199, 89, 0.3);
}

.status-chip.warn {
  background: rgba(255, 149, 0, 0.1);
  color: #c4750e;
  border-color: rgba(255, 149, 0, 0.3);
}

.status-chip.bad {
  background: rgba(255, 59, 48, 0.08);
  color: var(--danger);
  border-color: rgba(255, 59, 48, 0.25);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
}

.status-chip.ok .status-dot {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.2);
}

.status-chip.warn .status-dot {
  background: #ff9500;
  box-shadow: 0 0 0 4px rgba(255, 149, 0, 0.18);
}

.status-chip.bad .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.18);
}

.status-chip-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Board-required prompt modal ===== */
.prompt-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 25, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  padding: 24px;
  animation: promptFadeIn 0.2s ease-out;
}

.prompt-overlay.hidden { display: none; }

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

.prompt-card {
  background: white;
  padding: 36px 40px 28px;
  border-radius: 24px;
  text-align: center;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
  animation: promptCardPop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes promptCardPop {
  from { transform: scale(0.9) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.prompt-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, #007aff 0%, #0a4eb3 100%);
  color: white;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.4);
}

.prompt-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.prompt-sub {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.5;
  margin-bottom: 22px;
  font-weight: 500;
}

.prompt-card .btn-primary {
  width: 100%;
  margin-bottom: 12px;
}

.prompt-skip {
  display: inline-block;
  font-size: 12px;
  color: var(--text-faint);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
  padding: 6px 8px;
  transition: color 0.15s;
}

.prompt-skip:hover { color: var(--text-soft); }

/* ===== Sound toggle checkboxes ===== */
.sound-toggles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 14px;
}

.toggle-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 0;
  align-items: center;
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
}

.toggle-row input[type=checkbox] {
  grid-row: 1 / span 2;
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--line);
  background: white;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 0;
}

.toggle-row input[type=checkbox]:hover {
  border-color: var(--accent);
}

.toggle-row input[type=checkbox]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-row input[type=checkbox]:checked::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 11px;
  border: solid white;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.toggle-name {
  grid-column: 2;
  grid-row: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.toggle-sub {
  grid-column: 2;
  grid-row: 2;
  font-size: 12px;
  color: var(--text-faint);
  font-weight: 500;
  line-height: 1.3;
}

.toggle-row input[type=checkbox]:not(:checked) ~ .toggle-name {
  color: var(--text-faint);
}

.setup-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(420px, 1.4fr);
  gap: 28px;
  align-items: start;
}

@media (max-width: 900px) {
  .setup-grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
}

.card-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.card-subtle {
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 18px;
  font-weight: 500;
}

/* Time picker */
.time-picker {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  margin: 24px 0 18px;
}

.time-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 110px;
}

.time-col input {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(40px, 6vw, 60px);
  font-weight: 700;
  text-align: center;
  width: 100%;
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 14px 4px;
  color: var(--text);
  letter-spacing: -0.02em;
  transition: border-color 0.15s, background 0.15s;
}

.time-col input:focus {
  border-color: var(--accent);
  background: #fff;
}

.time-col input::-webkit-outer-spin-button,
.time-col input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.time-col input { -moz-appearance: textfield; }

.time-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 6px;
}

.time-sep {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(34px, 5vw, 50px);
  color: var(--text-faint);
  padding: 0 2px;
  margin-bottom: 32px;
  font-weight: 500;
}

.quick-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
}

.quick-btn {
  padding: 8px 14px;
  background: var(--bg);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  border: 1px solid transparent;
  transition: all 0.15s;
}

.quick-btn:hover {
  background: #fff;
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* Buttons */
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: white;
  font-size: 17px;
  font-weight: 700;
  padding: 16px 24px;
  border-radius: 14px;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 14px rgba(255, 107, 53, 0.32);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary.flash-error {
  background: var(--danger);
  animation: flashShake 0.6s ease-out;
}

@keyframes flashShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.btn-secondary {
  background: rgba(255,255,255,0.16);
  color: white;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 24px;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  transition: background 0.15s;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.26);
}

.btn-small {
  font-size: 13px;
  padding: 8px 16px;
}

.hardware-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.hardware-status {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-faint);
  font-weight: 500;
  line-height: 1.4;
}

.btn-ble {
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid var(--line);
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-ble::before {
  content: '';
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-faint);
  display: inline-block;
}

.btn-ble.connected {
  background: rgba(52, 199, 89, 0.1);
  color: var(--success);
  border-color: rgba(52, 199, 89, 0.3);
}

.btn-ble.connected::before {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(52,199,89,0.2);
}

.btn-ble:hover {
  border-color: var(--accent);
}

.ble-status {
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 500;
}

/* Settings foldout */
.settings-foldout {
  margin-top: 16px;
  font-size: 13px;
}

.settings-foldout summary {
  cursor: pointer;
  color: var(--text-soft);
  padding: 8px 0;
  font-weight: 600;
  list-style: none;
  user-select: none;
}

.settings-foldout summary::before {
  content: '+ ';
  color: var(--text-faint);
}

.settings-foldout[open] summary::before {
  content: '- ';
}

.settings-body {
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setting-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 500;
}

.setting-row input[type=number] {
  width: 60px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  color: var(--text);
}

.setting-row input[type=range] {
  width: 100px;
}

.setting-suffix {
  font-size: 12px;
  color: var(--text-faint);
  min-width: 50px;
  text-align: right;
  font-weight: 600;
}

/* Pose grid */
.pose-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.pose-tile {
  position: relative;
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 16px 12px 12px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  user-select: none;
}

.pose-tile:hover {
  background: #fff;
  border-color: var(--line);
  transform: translateY(-2px);
}

.pose-tile.selected {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(255, 107, 53, 0.18);
}

.pose-tile-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  transition: background 0.15s;
}

.pose-tile.selected .pose-tile-check {
  background: var(--accent);
}

.pose-tile-icon {
  width: 64px;
  height: 80px;
  margin: 0 auto 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pose-tile-icon svg {
  width: 100%;
  height: 100%;
}

.pose-tile-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.005em;
}

.pose-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-soft);
}

.link {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s;
}

.link:hover { color: var(--accent-deep); }

.dotsep { color: var(--text-faint); }

.picker-count {
  margin-left: auto;
  color: var(--text-faint);
  font-weight: 600;
  font-size: 12px;
}

.setup-foot {
  text-align: center;
  margin-top: 40px;
  font-size: 12px;
  color: var(--text-faint);
  font-weight: 500;
}

/* =============================================================
   RUNNING VIEW
   ============================================================= */
.view-running-pane {
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #0f1419 0%, #1a2025 100%);
  color: white;
}

.running-inner {
  text-align: center;
  padding: 32px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.08);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  letter-spacing: 0.02em;
  margin-bottom: 32px;
  border: 1px solid rgba(255,255,255,0.1);
}

.status-pulse {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.6); }
  50% { opacity: 0.6; transform: scale(1.1); box-shadow: 0 0 0 8px rgba(255, 107, 53, 0); }
}

.big-clock {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(80px, 18vw, 220px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: white;
  text-shadow: 0 0 60px rgba(255, 107, 53, 0.4);
}

.running-label {
  font-size: 16px;
  color: rgba(255,255,255,0.6);
  margin-top: 24px;
  margin-bottom: 36px;
  font-weight: 500;
}

/* =============================================================
   ALARM VIEW (the dramatic one)
   ============================================================= */
.view-alarm-pane {
  align-items: stretch;
  position: relative;
  overflow: hidden;
  color: white;
  background: #0a0006;
}

.alarm-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(230, 57, 70, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(213, 0, 50, 0.5) 0%, transparent 50%),
    linear-gradient(135deg, #2d0009 0%, #1a0005 100%);
  animation: alarmPulse 1.2s ease-in-out infinite;
  z-index: 0;
}

@keyframes alarmPulse {
  0%, 100% { filter: brightness(1) saturate(1); }
  50% { filter: brightness(1.3) saturate(1.3); }
}

.alarm-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  padding: 24px;
  width: 100%;
  min-height: 100vh;
}

@media (max-width: 900px) {
  .alarm-grid { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
}

.alarm-cam-wrap {
  position: relative;
  background: rgba(0,0,0,0.4);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid rgba(255, 80, 80, 0.4);
  box-shadow: 0 0 80px rgba(230, 57, 70, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.alarm-cam-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  display: block;
}

.alarm-cam-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.defuse-meter {
  position: absolute;
  bottom: 70px;
  left: 16px;
  right: 16px;
  height: 14px;
  background: rgba(0,0,0,0.5);
  border-radius: 100px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.defuse-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffc857 0%, #34c759 100%);
  border-radius: 100px;
  transition: width 0.08s linear;
  box-shadow: 0 0 12px rgba(52, 199, 89, 0.6);
}

.defuse-meter-label {
  position: absolute;
  top: -22px;
  left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.confidence-strip {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: rgba(0,0,0,0.6);
  border-radius: 100px;
  backdrop-filter: blur(12px);
  font-size: 12px;
  font-weight: 600;
}

.conf-tag {
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.conf-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.15);
  border-radius: 100px;
  overflow: hidden;
}

#confidenceFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff6b35, #ffc857);
  border-radius: 100px;
  transition: width 0.08s linear;
}

#confidencePct {
  color: white;
  min-width: 36px;
  text-align: right;
}

.alarm-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.alarm-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #e63946 0%, #b71c2c 100%);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(230, 57, 70, 0.5);
  animation: bannerShake 0.5s ease-in-out infinite;
}

@keyframes bannerShake {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(-2px) rotate(-0.5deg); }
  75% { transform: translateX(2px) rotate(0.5deg); }
}

.alarm-icon {
  font-size: 28px;
  font-weight: 900;
  color: white;
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.alarm-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: white;
}

.pose-call {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  background: rgba(255,255,255,0.04);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(20px);
}

.big-pose-icon {
  width: 180px;
  height: 240px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.big-pose-icon svg {
  width: 100%;
  height: 100%;
}

.big-pose-name {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: white;
  margin-bottom: 8px;
}

.big-pose-instruction {
  font-size: 15px;
  color: rgba(255,255,255,0.75);
  font-weight: 500;
  line-height: 1.4;
  max-width: 320px;
}

.alarm-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.alarm-hint {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  font-weight: 600;
}

/* =============================================================
   DEFUSED VIEW
   ============================================================= */
.view-defused-pane {
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a2e1a 0%, #0f4023 100%);
  color: white;
}

.defused-card {
  text-align: center;
  padding: 48px;
}

.defused-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px; height: 96px;
  background: linear-gradient(135deg, var(--success) 0%, #20a040 100%);
  color: white;
  border-radius: 50%;
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 28px;
  box-shadow: 0 12px 40px rgba(52, 199, 89, 0.5);
  animation: badgePop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

@keyframes badgePop {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.defused-title {
  font-size: clamp(48px, 8vw, 88px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff 0%, #b8eccd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.defused-stat {
  font-size: 18px;
  color: rgba(255,255,255,0.75);
  margin-bottom: 36px;
  font-weight: 500;
}

.view-defused-pane .btn-primary {
  width: auto;
  padding: 16px 36px;
}

/* =============================================================
   MODEL LOADING OVERLAY
   ============================================================= */
.model-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.3s;
}

.model-overlay.hidden { display: none; }
.model-overlay.fadeout { opacity: 0; pointer-events: none; }

.model-card {
  background: white;
  padding: 36px 48px;
  border-radius: 24px;
  text-align: center;
  max-width: 360px;
  width: 90%;
}

.model-ring-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
}

.model-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.model-track {
  fill: none;
  stroke: #f0f0f4;
  stroke-width: 8;
}

.model-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 276;
  stroke-dashoffset: 276;
  transition: stroke-dashoffset 0.3s ease;
}

.model-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
}

.model-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.model-stage {
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 500;
  min-height: 1.4em;
}

/* =============================================================
   CAMERA ERROR
   ============================================================= */
.cam-error-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.cam-error-overlay.hidden { display: none; }

.cam-error-card {
  background: white;
  padding: 32px 40px;
  border-radius: 20px;
  text-align: center;
  max-width: 380px;
}

.cam-error-card h3 {
  font-size: 22px;
  margin-bottom: 8px;
  color: var(--danger);
}

.cam-error-card p {
  color: var(--text-soft);
  margin-bottom: 20px;
}

.cam-error-card .btn-primary {
  width: auto;
  padding: 12px 24px;
}

/* =============================================================
   STICK FIGURE BASE STYLES
   ============================================================= */
.stick-fig {
  stroke: currentColor;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.stick-fig .head {
  fill: currentColor;
  stroke: none;
}

.pose-tile-icon { color: var(--text); }
.pose-tile.selected .pose-tile-icon { color: var(--accent); }
.big-pose-icon { color: white; }
