/* ========== Palasina Timer — Full Stylesheet ========== */
/* Brand palette */
:root {
  --bg: #ffe4e4;       /* background */
  --timer: #ff6b6b;    /* timer digits */
  --text: #7e5a9b;     /* primary text */
  --muted: #9a7bb8;    /* secondary text */
  --panel: #fff4f4;    /* cards/panels */
  --border: #f3caca;   /* borders/dividers */
  --success: #35b36b;
  --danger: #d64545;
  --warn: #f5a524;
  --focus: #b68ad6;    /* focus ring */
}

/* Basic reset */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout helpers */
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px;
}
.header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 20px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.03);
}

/* Typography */
h1, h2, h3 {
  margin: 0 0 12px 0;
  font-weight: 700;
  color: var(--text);
}
h1 { font-size: clamp(28px, 5vw, 40px); }
h2 { font-size: clamp(22px, 3.4vw, 28px); }
h3 { font-size: clamp(18px, 2.6vw, 22px); }
p { margin: 0 0 12px 0; color: var(--text); }
small, .muted { color: var(--muted); }

/* Links */
a, .link {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
a:hover, .link:hover { border-bottom-color: currentColor; }

/* Buttons */
button, .btn, input[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 10px 14px; border-radius: 10px;
  font-weight: 600; cursor: pointer; transition: transform .05s ease, opacity .15s ease;
}
button:active, .btn:active, input[type="submit"]:active { transform: translateY(1px); }

button.primary, .btn.primary, input[type="submit"].primary {
  background: var(--timer); color: #fff; border: 0;
}
button.secondary, .btn.secondary {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
button.ghost, .btn.ghost {
  background: transparent; color: var(--muted); border: 0;
}
button.danger, .btn.danger { background: var(--danger); color:#fff; border:0; }
button.success, .btn.success { background: var(--success); color:#fff; border:0; }

/* Forms */
form { display: grid; gap: 12px; }
label { font-weight: 600; color: var(--text); }
input[type="text"], input[type="number"], input[type="password"], select {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: #fff; color: var(--text);
  outline: none; transition: box-shadow .15s ease, border-color .15s ease;
}
input::placeholder { color: #b999cc; }
input:focus, select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent);
}

/* Timer */
.timer {
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  color: var(--timer);
  font-weight: 800;
  text-align: center;
  font-size: clamp(42px, 10vw, 120px);
  line-height: 1.1;
  margin: 10px 0 16px;
}
.timer-caption { text-align: center; color: var(--muted); }

/* Tables (results list) */
.table {
  width: 100%; border-collapse: collapse; border-spacing: 0;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.table th, .table td {
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border);
}
.table thead th {
  background: #ffecec; color: var(--text); font-weight: 700;
}
.table tbody tr:hover { background: #fff8f8; }

/* Grid for host dashboard */
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Notices / badges */
.badge {
  display: inline-block; padding: 4px 8px; border-radius: 999px;
  font-size: 12px; line-height: 1; border: 1px solid var(--border); color: var(--muted);
}
.badge.live { color: #fff; background: var(--success); border-color: transparent; }
.badge.ended { color: #fff; background: var(--danger); border-color: transparent; }

/* Spacing utils */
.mt-0{margin-top:0}.mt-4{margin-top:16px}.mt-6{margin-top:24px}
.mb-0{margin-bottom:0}.mb-2{margin-bottom:8px}.mb-4{margin-bottom:16px}.mb-6{margin-bottom:24px}
.pt-2{padding-top:8px}.pt-4{padding-top:16px}.pb-4{padding-bottom:16px}

/* Layout sections often used */
.section { margin: 16px 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Big screen tweaks */
.display-wrap { text-align: center; }
.display-wrap .timer { font-size: clamp(64px, 12vw, 160px); }

/* Forms row helper */
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 260px; }

/* Divider */
.hr {
  height: 1px; background: var(--border);
  margin: 16px 0; border: 0;
}

/* Inputs inline with buttons */
.input-inline { display: flex; gap: 8px; align-items: center; }
.input-inline input { flex: 1; }

/* Warnings for last 10 minutes — JS may add visual filters, this is a color hint class if you use it */
.time-warning { filter: saturate(1.15) brightness(1.05); }

/* Footer / small print */
.footer { margin-top: 32px; text-align: center; color: var(--muted); font-size: 14px; }

/* Accessibility: focus rings for buttons/links */
button:focus-visible, .btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 45%, transparent);
  outline-offset: 2px;
  border-radius: 10px;
}

/* Ensure socket.io script and custom scripts don't shift layout */
script { display: none !important; }
/* Bigger STOP button (safe additive) */
.btn-stop {
  font-size: clamp(20px, 3.2vw, 28px);
  padding: 18px 28px;
  min-width: 220px;
  border-radius: 14px;
}