/* tippr — styled after the GOV.UK Design System (colours, type, focus,
   square edges, flat surfaces). Class names are unchanged so templates stay
   the same; only the look changes. */
:root {
  --black: #0b0c0c;
  --white: #ffffff;
  --blue: #1d70b8;
  --dark-blue: #003078;
  --green: #00703c;
  --green-dark: #005a30;
  --green-shadow: #002d18;
  --yellow: #ffdd00;
  --grey-mid: #505a5f;   /* secondary text */
  --grey-line: #b1b4b6;  /* borders */
  --grey-light: #f3f2f1; /* subtle backgrounds */
  --tag-blue-bg: #d2e2f1;
  --tag-blue-ink: #144e81;
  --correct-bg: #cce2d8;
  --correct-ink: #005a30;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "GDS Transport", arial, sans-serif;
  font-size: 1.1875rem;   /* 19px — GOV.UK body size */
  line-height: 1.35;
  color: var(--black);
  background: var(--white);
}

/* Signature GOV.UK focus state */
a:focus,
button:focus,
input:focus,
.linklike:focus,
[tabindex]:focus {
  outline: 3px solid transparent;
  color: var(--black);
  background-color: var(--yellow);
  box-shadow: 0 -2px var(--yellow), 0 4px var(--black);
  text-decoration: none;
}
input:focus {
  outline: 3px solid var(--yellow);
  outline-offset: 0;
  box-shadow: inset 0 0 0 2px var(--black);
  background-color: var(--white);
}

/* Header */
.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
  background: var(--black);
  border-bottom: 10px solid var(--blue);
  flex-wrap: wrap;
}
.topbar .brand {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.5px;
  color: var(--white);
  text-decoration: none;
}
.topbar .brand:focus { color: var(--black); }
.topbar nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
}
.topbar nav a { color: var(--white); text-decoration: none; font-size: 1rem; }
.topbar nav a:hover { text-decoration: underline; text-decoration-thickness: 3px; }
.logout-form { margin: 0; display: inline; }
.linklike {
  background: none; border: 0; color: var(--white); cursor: pointer;
  font: inherit; font-size: 1rem; padding: 0; text-decoration: underline;
}

.container { max-width: 960px; margin: 1.5rem auto; padding: 0 1rem; }

/* Surfaces — flat, square, bordered (GOV.UK summary-card feel) */
.card {
  background: var(--white);
  border: 1px solid var(--grey-line);
  padding: 1rem 1.25rem 1.25rem;
  margin-bottom: 1.25rem;
}
.card.narrow { max-width: 420px; margin: 3rem auto; }

h1 { font-size: 2.25rem; line-height: 1.1; font-weight: 700; margin: 0 0 0.5rem; }
h2 { font-size: 1.5rem; line-height: 1.15; font-weight: 700; margin: 0 0 0.75rem; }
.sub { color: var(--grey-mid); margin: 0 0 0.75rem; }
.hint { color: var(--grey-mid); font-size: 1rem; }

a { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.1em; }
a:hover { color: var(--dark-blue); text-decoration-thickness: 3px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

/* Buttons — GOV.UK green with 2px "pressable" shadow, square corners */
.btn {
  display: inline-block;
  background: var(--green);
  color: var(--white);
  border: 2px solid transparent;
  border-radius: 0;
  padding: 0.5rem 1.1rem;
  font-size: 1.1875rem;
  font-weight: 400;
  cursor: pointer;
  margin-top: 1.25rem;
  box-shadow: 0 2px 0 var(--green-shadow);
  text-decoration: none;
}
.btn:hover { background: var(--green-dark); }
.btn:active { top: 2px; }

label { display: block; margin: 0.9rem 0; font-weight: 700; }
label input {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.5rem;
  border: 2px solid var(--black);
  border-radius: 0;
  font: inherit;
}

/* Messages / notifications */
.messages { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.msg { padding: 0.75rem 1rem; margin-bottom: 0.5rem; border-left: 5px solid; }
.msg-success { background: var(--correct-bg); border-color: var(--green); }
.msg-error { background: #f6d7d2; border-color: #d4351c; }
.msg-info { background: var(--grey-light); border-color: var(--blue); }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.table th, .table td {
  text-align: left; padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--grey-line);
}
.table th { font-weight: 700; }
.table th.num, .table td.num { text-align: right; }
.table tr.me { background: var(--grey-light); }
.table tr.me td { font-weight: 700; }
.team-cell { display: flex; align-items: center; gap: 0.4rem; }

.tag {
  display: inline-block;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 1px 7px; color: var(--tag-blue-ink); background: var(--tag-blue-bg);
  vertical-align: middle;
}

.crest { width: 24px; height: 24px; object-fit: contain; }
.crest.sm { width: 18px; height: 18px; }

/* Drag & drop list */
.team-list { list-style: none; padding: 0; margin: 1.25rem 0 0; }
.team-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--grey-line);
  background: var(--white);
  margin-bottom: -1px;           /* collapse adjacent borders */
}
.team-row .rank { width: 2.4rem; color: var(--grey-mid); font-variant-numeric: tabular-nums; font-weight: 700; }
.drag-handle { cursor: grab; color: var(--grey-mid); font-size: 1.2rem; user-select: none; }
.team-row .team-name { font-weight: 700; }
.team-row.dragging { background: var(--yellow); opacity: 0.9; }

/* All tips — horizontally scrollable columns */
.tips-scroll { display: flex; gap: 0.85rem; overflow-x: auto; padding-bottom: 0.5rem; margin-top: 0.75rem; }
.tip-col {
  flex: 0 0 230px;
  border: 1px solid var(--grey-line);
}
.tip-col.me { border: 2px solid var(--green); position: relative; }
.tip-col.actual { border: 2px solid var(--blue); }
.tip-head {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--grey-light); padding: 0.5rem 0.6rem; font-size: 0.95rem; font-weight: 700;
  border-bottom: 1px solid var(--grey-line);
}
.tip-col.me .tip-head { background: var(--correct-bg); }
.tip-col.actual .tip-head { background: var(--blue); color: var(--white); }
.tip-points { font-weight: 700; }
.tip-list { list-style: none; margin: 0; padding: 0; }
.tip-list li {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.5rem; border-top: 1px solid var(--grey-line); font-size: 0.95rem;
}
.tip-list li:first-child { border-top: 0; }
.tip-list li.correct { background: var(--correct-bg); color: var(--correct-ink); font-weight: 700; }
.tip-list .pos { width: 2rem; color: var(--grey-mid); font-variant-numeric: tabular-nums; }
.tip-list li.correct .pos { color: var(--correct-ink); }
.tip-list .tname { flex: 1; }
.tip-list .cur { color: var(--grey-mid); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
/* Deviation arrow: how many places off the current table a tip is */
.tip-list .delta { font-size: 0.8rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tip-list .delta.up { color: var(--green); }      /* team ranked higher than tipped */
.tip-list .delta.down { color: #d4351c; }          /* team ranked lower than tipped */
.tip-list .delta.same { color: var(--green); }
.tip-list li.correct .delta.same { color: var(--correct-ink); }

pre { background: var(--black); color: #f3f2f1; padding: 0.75rem 1rem; overflow-x: auto; font-size: 1rem; }
