:root {
  --navy: #0f172a;
  --navy-2: #172554;
  --blue: #3f86bd;
  --blue-dark: #2563a6;
  --blue-soft: #e8f2fb;
  --ink: #18212f;
  --muted: #64748b;
  --line: #dbe3ec;
  --surface: #ffffff;
  --page: #f4f7fb;
  --green: #16a34a;
  --shadow: 0 12px 30px rgba(15, 23, 42, .08);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 50% -10%, #eaf3fc 0, var(--page) 42%, #eef2f7 100%);
  line-height: 1.5;
}

a { color: var(--blue-dark); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }

.ccrl-header {
  width: 100%;
  background: linear-gradient(135deg, var(--navy) 0%, #162b4f 58%, #214b76 100%);
  color: white;
  border-bottom: 3px solid var(--blue);
  box-shadow: 0 5px 20px rgba(15, 23, 42, .16);
}
.ccrl-header-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.ccrl-logo {
  width: 62px;
  height: 62px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,.25));
}
.ccrl-brand { display: flex; flex-direction: column; gap: 1px; }
.ccrl-title {
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 800;
  letter-spacing: -.5px;
  line-height: 1.05;
}
.ccrl-subtitle {
  color: #bfdbfe;
  font-size: 13px;
  font-weight: 500;
}

.ccrl-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 48px;
}
.ccrl-card {
  background: rgba(255,255,255,.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.ccrl-card-pad { padding: clamp(20px, 3vw, 34px); }
.ccrl-hero { text-align: center; margin-bottom: 22px; }
.ccrl-hero h1 { margin: 0 0 8px; font-size: clamp(25px, 4vw, 36px); letter-spacing: -.5px; }
.ccrl-hero p { margin: 5px auto; max-width: 820px; color: var(--muted); }
.ccrl-kicker {
  display: inline-block;
  margin-bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .7px;
}

.ccrl-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 24px;
}
.ccrl-stat {
  padding: 9px 13px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #475569;
  font-size: 13px;
}
.ccrl-stat strong { color: var(--ink); }

.ccrl-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; margin: 20px 0 28px; }
.ccrl-button, input[type="submit"], button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  padding: 10px 15px;
  background: var(--blue-dark);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 166, .2);
}
.ccrl-button:hover, input[type="submit"]:hover, button:hover { background: #1d4f86; text-decoration: none; }
.ccrl-button.secondary { background: #eef4fa; color: var(--blue-dark); box-shadow: none; border: 1px solid #d6e4f1; }
.ccrl-button.secondary:hover { background: #e1edf8; }

.ccrl-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; }
.ccrl-table { width: 100%; border-collapse: collapse; margin: 0; background: #fff; }
.ccrl-table th {
  background: #f1f5f9;
  color: #334155;
  padding: 13px 14px;
  text-align: left;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .35px;
  white-space: nowrap;
}
.ccrl-table td { padding: 12px 14px; border-top: 1px solid #e5eaf0; }
.ccrl-table tr:hover td { background: #f8fbff; }
.ccrl-table td:first-child { color: var(--muted); font-weight: 700; }

.ccrl-form-card { max-width: 680px; margin: 0 auto; }
.ccrl-form-title { text-align: center; margin: 0 0 5px; font-size: 29px; }
.ccrl-form-subtitle { text-align: center; color: var(--muted); margin: 0 0 24px; }
.ccrl-opponent {
  padding: 14px 16px;
  background: var(--blue-soft);
  border: 1px solid #cfe1f1;
  border-radius: 12px;
  margin-bottom: 22px;
}
.ccrl-opponent strong { color: var(--blue-dark); }
.ccrl-form-row { margin: 18px 0; }
.ccrl-label { display: block; font-weight: 750; margin-bottom: 8px; }
.ccrl-help { color: var(--muted); font-size: 13px; margin-top: 5px; }
.ccrl-choice { display: flex; flex-wrap: wrap; gap: 12px; }
.ccrl-choice label {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer;
}
.ccrl-input {
  width: 90px; padding: 10px 11px; border: 1px solid #cbd5e1; border-radius: 9px; font: inherit; background: #fff;
}
.ccrl-input:disabled { background: #f1f5f9; color: #94a3b8; }
.ccrl-check { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.ccrl-form-footer { text-align: center; margin-top: 22px; }

.ccrl-game-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.ccrl-game-head h1 { margin: 0; font-size: 27px; }
.ccrl-engine-pill { padding: 7px 11px; background: #eef4fa; color: var(--blue-dark); border-radius: 999px; font-size: 13px; font-weight: 800; }
.ccrl-game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 22px; align-items: start; }
.ccrl-board-card { padding: 16px; background: #f8fafc; border: 1px solid var(--line); border-radius: 14px; }
.ccrl-board-card .board-div { margin: 0 auto; }
.ccrl-info-card { min-height: 150px; padding: 15px; background: #fff; border: 1px solid var(--line); border-radius: 13px; color: #475569; font-size: 14px; }
.ccrl-pgn-card { margin-top: 18px; padding: 13px 15px; background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
.ccrl-engine-details { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); color: #475569; }
.ccrl-engine-details strong { color: var(--ink); }
.ccrl-engine-image { max-width: min(420px, 100%); max-height: 150px; object-fit: contain; border-radius: 10px; margin-bottom: 10px; }
.ccrl-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* Keep Chessboard.js behaviour intact while making the surrounding UI cleaner. */
#myBoard {
  width: min(500px, 100%) !important;
  height: auto !important;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(15,23,42,.12);
}

@media (max-width: 800px) {
  .ccrl-game-layout { grid-template-columns: 1fr; }
  .ccrl-info-card { width: 100%; }
}
@media (max-width: 600px) {
  .ccrl-header-inner, .ccrl-shell { width: min(100% - 20px, 1180px); }
  .ccrl-header-inner { min-height: 70px; }
  .ccrl-logo { width: 50px; height: 50px; }
  .ccrl-subtitle { display: none; }
  .ccrl-shell { margin-top: 15px; }
  .ccrl-card-pad { padding: 16px; }
  .ccrl-game-layout { gap: 12px; }
  .ccrl-board-card { padding: 8px; }
}
