:root {
  --bg: #1c1b22;
  --panel: #26262f;
  --panel-2: #2f2f3a;
  --text: #ececf0;
  --muted: #a6a6b3;
  --accent: #f6c945;
  --accent-2: #5b8def;
  --ok: #3fbf66;
  --bad: #e06363;
  --tie: #e7b341;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  background: radial-gradient(1200px 800px at 70% -10%, #2b2b38, var(--bg));
  color: var(--text);
  min-height: 100vh;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 18px 40px;
}

h1 {
  font-size: 1.7rem;
  font-weight: 700;
  margin: 0 0 18px;
  letter-spacing: 0.3px;
}
h1 .sub { color: var(--muted); font-weight: 400; font-size: 1.1rem; }

.layout {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  flex-wrap: wrap;
}

/* --- Šachovnice --- */
.board-holder {
  position: relative;
  line-height: 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  border: 3px solid #15141a;
}

#board {
  display: block;
  width: min(544px, 92vw);
  height: auto;
  aspect-ratio: 1 / 1;
  cursor: pointer;
}

.overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  background: rgba(10, 10, 14, 0.66);
  backdrop-filter: blur(2px);
  cursor: pointer;
}
.overlay.show { display: flex; }

/* --- Boční panel --- */
.panel {
  flex: 1 1 240px;
  min-width: 240px;
  background: var(--panel);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.group { margin-top: 16px; }
.lbl { display: block; color: var(--muted); font-size: 0.85rem; margin-bottom: 6px; }

button {
  font: inherit;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid #3c3c49;
  padding: 9px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
button:hover { background: #3a3a47; }
button:active { transform: translateY(1px); }

button.primary {
  width: 100%;
  background: var(--accent);
  color: #2a2410;
  font-weight: 700;
  border: none;
  padding: 12px;
  font-size: 1rem;
}
button.primary:hover { background: #ffd84d; }

.btn-row { display: flex; gap: 8px; }
.btn-row button { flex: 1; }
button.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: #3a3526;
}

/* Přepínač jazyka: oddělit od ostatních ovládacích prvků jemným předělem */
.lang-switch {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #3a3a47;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.flag {
  width: 21px;
  height: 14px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
  flex: none;
}

select {
  font: inherit;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid #3c3c49;
  padding: 9px 10px;
  border-radius: 8px;
  width: 100%;
  cursor: pointer;
}

.status {
  margin-top: 18px;
  padding: 12px 14px;
  background: var(--panel-2);
  border-radius: 8px;
  font-weight: 600;
  min-height: 1.2em;
}

.counts { margin-top: 14px; display: grid; gap: 8px; }
.count-row { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; color: var(--muted); }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; border: 1px solid #000; }
.dot.white { background: #f7f5ef; }
.dot.black { background: #33343d; }

.rules { margin-top: 18px; font-size: 0.88rem; color: var(--muted); }
.rules summary { cursor: pointer; color: var(--text); font-weight: 600; padding: 6px 0; }
.rules ul { margin: 8px 0 0; padding-left: 18px; }
.rules li { margin-bottom: 7px; line-height: 1.4; }
.rules .ok { color: var(--ok); font-weight: 600; }
.rules .bad { color: var(--bad); font-weight: 600; }
.rules .tie { color: var(--tie); font-weight: 600; }

/* Odkaz na Facebookovou skupinu pod pravidly */
.fb-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}
.fb-link:hover { color: var(--accent-2); text-decoration: underline; }
.fb-icon { width: 18px; height: 18px; flex: none; }
