:root {
  --bg: #0f1115;
  --card: #171a21;
  --text: #f5f7fa;
  --muted: #9aa4b2;
  --orange: #ff9800;
  --pulse: #42a5f5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at top, #1b2430, var(--bg));
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.card {
  width: min(420px, 100%);
  background: var(--card);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  border: 1px solid #2a3140;
}

.card.active {
  animation: pulse 1.2s ease-in-out infinite;
  border-color: var(--pulse);
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(66, 165, 245, 0.35); }
  50% { box-shadow: 0 0 0 10px rgba(66, 165, 245, 0); }
}

h1 {
  margin: 0 0 8px;
  font-size: 1.6rem;
}

.subtle {
  color: var(--muted);
  margin-bottom: 24px;
}

.stamp-grid {
  display: flex;
  gap: 10px;
  justify-content: center;
  font-size: 2rem;
  margin: 24px 0;
}

.ready-banner {
  background: linear-gradient(135deg, #1b5e20, #43a047);
  color: #e8f5e9;
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 20px;
}

.timer {
  font-size: 3rem;
  font-weight: 800;
  text-align: center;
  margin: 24px 0 0;
  font-variant-numeric: tabular-nums;
}

.active-prompt {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 600;
  margin: 8px 0 0;
  line-height: 1.4;
}

.ready-details {
  text-align: center;
  color: var(--muted);
  margin: 0 0 8px;
  line-height: 1.5;
}

.ready-details strong {
  color: var(--text);
  font-weight: 600;
}

#ready-view button {
  margin-top: 16px;
}

button {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--orange);
  color: #111;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  background: var(--orange);
  color: #111;
  border: none;
  margin-top: 0;
  border-radius: 12px;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: inherit;
}

.corkboard {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #2a3140;
}

.corkboard-top {
  margin-top: 0;
  margin-bottom: 20px;
  padding-top: 0;
  border-top: none;
}

.corkboard h2 {
  margin: 0 0 12px;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.community-btn {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(135deg, #3d2c5c, #5e4b8a);
  color: #f3e8ff;
  border: 1px solid #6b5a9a;
}

.connect-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.connect-link {
  flex: 1 1 auto;
  min-width: 100px;
  text-align: center;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  background: #10141b;
  color: var(--text);
  border: 1px solid #2a3140;
}

.connect-link:hover {
  border-color: var(--orange);
}

.hidden { display: none; }

.error {
  color: #ef9a9a;
  text-align: center;
}

.today-banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 152, 0, 0.12);
  border: 1px solid rgba(255, 152, 0, 0.35);
  font-size: 0.92rem;
  line-height: 1.45;
  color: #ffcc80;
}

.announcements-block {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(100, 181, 246, 0.1);
  border: 1px solid rgba(100, 181, 246, 0.35);
  font-size: 0.92rem;
  line-height: 1.5;
}

.announcements-block h2 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #90caf9;
  font-weight: 700;
}

.announcements-title {
  margin: 0 0 10px;
  font-size: 1.35rem;
  line-height: 1.25;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

.announcements-block p:not(.announcements-title) {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text);
  white-space: pre-wrap;
}

.public-corkboard-link {
  display: block;
  text-align: center;
  margin-top: 20px;
  font-size: 0.88rem;
  color: #90caf9;
}

.segment-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.segment-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #2a3140;
  border-radius: 10px;
  background: #10141b;
  cursor: pointer;
}

.segment-option input {
  width: auto;
  margin: 0;
  accent-color: var(--orange);
}

.segment-option span {
  font-weight: 500;
}

.prefs-hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 12px;
  line-height: 1.45;
}

.prefs-link-btn {
  width: auto;
  padding: 0;
  margin: 0 0 12px;
  background: none;
  color: var(--orange);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
}

.prefs-status {
  margin: 0 0 12px;
  font-size: 0.9rem;
  text-align: center;
}

.prefs-status.ok {
  color: #81c784;
}

.prefs-status.err {
  color: #ef5350;
}

.prefs-status.hidden {
  display: none;
}

#save-segments-btn {
  margin-top: 4px;
}

.loyalty-block {
  margin: 24px 0 0;
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  background: linear-gradient(145deg, #1a2332, #10141b);
  border: 1px solid rgba(255, 152, 0, 0.35);
}

.loyalty-block h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
}

.loyalty-block p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.loyalty-block strong {
  color: var(--text);
}

.loyalty-block .btn {
  margin-top: 0;
}
