/* Tennyson VIPs — royal blue & white theme */
:root {
  --blue: #1f4fc4;          /* royal blue */
  --blue-dark: #163a94;
  --blue-deep: #0f2a6e;
  --blue-soft: #e8eefb;
  --blue-tint: #f4f7fd;
  --white: #ffffff;
  --text: #13234a;
  --muted: #5b6886;
  --red: #c62828;
  --line: #d9e1f2;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--blue-tint);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--blue); }
code { background: var(--blue-soft); padding: 1px 5px; border-radius: 4px; }

/* ---------- Header / nav ---------- */
header {
  background: var(--blue);
  border-bottom: 4px solid var(--white);
  box-shadow: 0 2px 12px rgba(15, 42, 110, 0.25);
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.5px;
  color: var(--white);
  text-decoration: none;
}
.brand img {
  height: 46px;
  width: auto;
  background: var(--white);
  border-radius: 8px;
  padding: 2px;
}
.brand span { color: #cfdcff; }
.nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-links a {
  color: var(--white);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
}
.nav-links a:hover { background: rgba(255, 255, 255, 0.15); }
.nav-links a.active { background: var(--white); color: var(--blue); }

/* ---------- Layout ---------- */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px 60px;
}
.hero {
  text-align: center;
  padding: 26px 16px 22px;
  margin: 0 -16px;
  background: linear-gradient(180deg, var(--blue-dark) 0%, var(--blue) 100%);
  color: var(--white);
  border-radius: 0 0 var(--radius) var(--radius);
}
.hero-logo {
  width: 130px;
  height: auto;
  background: var(--white);
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  margin-bottom: 10px;
}
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); margin: 0 0 6px; }
.hero p { color: #dbe5ff; margin: 0; }
.suits { color: var(--white); letter-spacing: 8px; font-size: 1.2rem; opacity: 0.85; }

section { margin-top: 28px; }
h2 {
  font-size: 1.4rem;
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 3px solid var(--blue);
  display: inline-block;
  color: var(--blue-deep);
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 4px 16px rgba(15, 42, 110, 0.08);
}
.card h3 { margin: 0 0 10px; color: var(--blue); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  color: var(--white);
  background: var(--blue);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
thead tr th:first-child { border-top-left-radius: 8px; }
thead tr th:last-child { border-top-right-radius: 8px; }
tbody tr:nth-child(even) td { background: var(--blue-tint); }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; }
tr.highlight td, tbody tr.highlight:nth-child(even) td { background: var(--blue-soft); font-weight: 700; color: var(--blue-deep); }
tfoot td { font-weight: 800; color: var(--blue); border-top: 2px solid var(--blue); background: var(--white); }

/* ---------- Cost list ---------- */
.cost-line {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.cost-line:last-child { border-bottom: none; }
.cost-total {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--blue);
  border-top: 2px solid var(--blue);
  border-bottom: none;
  margin-top: 4px;
  padding-top: 10px;
}

/* ---------- Chips ---------- */
.chip {
  display: inline-flex;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 4px dashed rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 2px rgba(19, 35, 74, 0.35);
  vertical-align: middle;
  margin-right: 10px;
}
.chip.black { background: #111; }
.chip.blue { background: #1f5fbf; }
.chip.green { background: #1f8a4c; }
.chip.red { background: #c62828; }
.chip.white { background: #fff; border-color: #1f5fbf; }

/* ---------- Timer ---------- */
.timer-card { text-align: center; padding: 26px 18px; }
.level-label { color: var(--muted); text-transform: uppercase; letter-spacing: 2px; font-size: 0.85rem; font-weight: 700; }
.blinds-now {
  font-size: clamp(2.4rem, 10vw, 4.5rem);
  font-weight: 900;
  color: var(--blue);
  margin: 4px 0;
  line-height: 1.1;
}
.clock {
  font-family: "Consolas", "Courier New", monospace;
  font-size: clamp(3.5rem, 16vw, 7rem);
  font-weight: 800;
  letter-spacing: 2px;
  margin: 6px 0;
  color: var(--blue-deep);
  font-variant-numeric: tabular-nums;
}
.clock.warning { color: #d97706; }
.clock.danger { color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }

.progress {
  height: 10px;
  background: var(--blue-soft);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px auto 14px;
  max-width: 600px;
}
.progress-bar { height: 100%; width: 100%; background: var(--blue); transition: width 0.3s linear; }

.next-up { color: var(--muted); margin-bottom: 18px; }
.next-up strong { color: var(--text); }

.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

button, .btn {
  font: inherit;
  font-weight: 700;
  border-radius: 10px;
  padding: 12px 20px;
  cursor: pointer;
  background: var(--white);
  color: var(--blue);
  border: 2px solid var(--blue);
  transition: transform 0.05s, background 0.15s;
}
button:hover { background: var(--blue-soft); }
button:active { transform: scale(0.97); }
button.primary { background: var(--blue); color: var(--white); min-width: 130px; }
button.primary:hover { background: var(--blue-dark); }
button.danger { background: var(--white); color: var(--red); border-color: rgba(198, 40, 40, 0.5); }
button.danger:hover { background: #fdecec; }
button.small { padding: 6px 12px; font-size: 0.85rem; }
button:disabled { opacity: 0.4; cursor: not-allowed; }

.banner {
  display: none;
  margin: 0 auto 14px;
  max-width: 600px;
  background: var(--blue);
  color: var(--white);
  font-weight: 800;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 1.1rem;
}
.banner.show { display: block; animation: pop 0.4s ease-out; }
@keyframes pop { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- Forms ---------- */
.form-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.form-row label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 0.9rem; color: var(--muted); }
input, select {
  font: inherit;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #b9c7e6;
  background: var(--white);
  color: var(--text);
  min-width: 150px;
}
input:focus, select:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.player-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  margin-bottom: 14px;
}
.player-pick {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--blue-tint);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}
.player-pick span { font-weight: 700; }
.player-pick select { min-width: 120px; }
.player-pick .pts { color: var(--blue); font-weight: 800; min-width: 44px; text-align: right; }

.msg { margin: 10px 0 0; font-weight: 600; min-height: 1.4em; }
.msg.error { color: var(--red); }
.msg.ok { color: #1b7f3b; }

/* ---------- History ---------- */
.history-item {
  background: var(--blue-tint);
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.history-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.history-head strong { color: var(--blue-deep); }
.tag { font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); margin-left: 6px; font-weight: 700; }
.tag.local { background: #fff4d6; color: #8a5a00; }
.finish-list { color: var(--muted); font-size: 0.95rem; }
.finish-list b { color: var(--text); }

.note { color: var(--muted); font-size: 0.9rem; }

.medal { font-size: 1.1rem; }

footer {
  text-align: center;
  color: var(--white);
  background: var(--blue);
  font-size: 0.85rem;
  padding: 18px 16px;
}

@media (max-width: 520px) {
  th, td { padding: 8px 8px; font-size: 0.92rem; }
  .card { padding: 14px; }
  .brand { font-size: 1.15rem; }
  .brand img { height: 38px; }
}
