/*
 * Chinese Checkers website: tokens, fonts, resets and the few shared building blocks
 * (container, eyebrow, card, button, form field). Light, in the game's palette
 * (flutter-app/lib/theme.dart) — re-themed 2026-11-08 from the original dark build to
 * match the actual approved design reference (root `Dama Cinese – Game Screen.pdf`,
 * `Home-html.zip`). Components and pages use only these tokens.
 */

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('../fonts/montserrat-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/open-sans-latin.woff2') format('woff2');
}

:root {
  color-scheme: light;

  /* The game's colours (flutter-app/lib/theme.dart AppColors) */
  --bg: #f4f2fb;
  --surface: #ffffff;
  --surface-2: #ece9f7;
  --ink: #1d1b3a;
  --muted: #6a6788;
  --primary: #f2542d;
  --primary-hover: #d6431f;
  --primary-text: #c23d1c;
  --on-primary: #ffffff;
  --good: #12a37a;
  --bad: #d92d20;
  --amber: #f5b700;
  --line: #e4e1f0;
  --track: #cfc9e8;
  --shadow: 0 10px 30px rgb(29 27 58 / 8%);
  --shadow-primary: 0 8px 24px rgb(242 84 45 / 35%);

  /* The six seats, fixed per board zone (flutter-app/lib/theme.dart AppColors.players):
     bottom, lowerLeft, upperLeft, top, upperRight, lowerRight. */
  --seat-1: #f2542d;
  --seat-2: #8e44ad;
  --seat-3: #2f5bea;
  --seat-4: #12a37a;
  --seat-5: #f5b700;
  --seat-6: #1d1b3a;

  --display: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
  --text: 'Open Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --radius-card: 18px;
  --radius-button: 16px;
  --radius-tile: 14px;

  --gutter: clamp(16px, 5vw, 40px);
  --column: 1120px;
  --focus-ring: 0 0 0 3px var(--bg), 0 0 0 5px var(--primary);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--text);
  overflow-x: clip;
}

main {
  flex: 1;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--primary-text);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary-hover);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 6px;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Layout */

.container {
  width: min(100% - 2 * var(--gutter), var(--column));
  margin-inline: auto;
}

/* The small uppercase label of the game */

.eyebrow {
  font: 600 12px/1.4 var(--text);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-text);
}

/* Cards */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  font: 600 16px/1.2 var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: transform 80ms ease, background-color 150ms ease, border-color 150ms ease;
}

.button:active {
  transform: scale(0.97);
}

.button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.button--primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-primary);
}

.button--primary:hover {
  background: var(--primary-hover);
  color: var(--on-primary);
}

.button--secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.button--secondary:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.button--danger {
  background: var(--surface);
  border-color: var(--bad);
  color: var(--bad);
}

.button--danger:hover {
  background: var(--surface-2);
  color: var(--bad);
}

.button__icon {
  width: 20px;
  height: 20px;
}

/* Form fields (contact form, new password) */

.field {
  display: grid;
  gap: 6px;
}

.field__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.field__label {
  font: 600 14px/1.4 var(--text);
}

.field__input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 16px;
}

.field__input:hover {
  border-color: var(--track);
}

.field__input:focus-visible {
  border-color: var(--primary);
  border-radius: 12px;
}

.field__input[aria-invalid] {
  border-color: var(--bad);
}

.field__hint,
.field__counter {
  font-size: 13px;
  color: var(--muted);
}

.field__counter {
  font-variant-numeric: tabular-nums;
}

.field__error {
  font-size: 14px;
  color: var(--bad);
}

.form-status {
  font-size: 15px;
  color: var(--muted);
}

.form-status:empty {
  display: none;
}

.form-status[data-tone='good'] {
  color: var(--good);
}

.form-status[data-tone='bad'] {
  color: var(--bad);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
