/* public/style.css — design system, trzymaj tu zmienne i reset */

:root {
  --color-primary: #3b82f6;
  --color-success: #22c55e;
  --color-danger:  #ef4444;
  --color-warning: #f59e0b;
  --color-purple:  #8b5cf6;

  --bg:           #ffffff;
  --bg-surface:   #f4f4f5;
  --text:         #18181b;
  --text-muted:   rgba(0,0,0,.5);
  --border:       rgba(0,0,0,.12);

  --space-xs: 4px;
  --space-s:  8px;
  --space-m:  12px;
  --space-l:  16px;
  --space-xl: 24px;
}

[data-theme="dark"] {
  --bg:         #111817;
  --bg-surface: #18181b;
  --text:       #fafafa;
  --text-muted: rgba(255,255,255,.5);
  --border:     rgba(255,255,255,.12);
}

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.35;
  background: var(--bg);
  color: var(--text);
}

/* Pulsing dot — używane w split banner */
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.45); opacity: .55; }
}
.split-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--color-danger);
  animation: pulse-dot 1.2s ease-in-out infinite;
  vertical-align: middle;
}
.split-dot.done { background: var(--color-success); }

/* Settings panel */
.settings-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 280px; max-width: 100vw;
  background: var(--bg);
  border-left: 1px solid var(--border);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform .22s ease;
  padding: var(--space-xl);
  overflow-y: auto;
}
.settings-panel.open { transform: translateX(0); }
.hand-left .settings-panel {
  right: auto; left: 0;
  border-left: none; border-right: 1px solid var(--border);
  transform: translateX(-100%);
}
.hand-left .settings-panel.open { transform: translateX(0); }
.settings-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.3);
  z-index: 999;
}
.settings-backdrop.open { display: block; }
.settings-close {
  position: absolute; top: var(--space-l); right: var(--space-l);
  background: none; border: none; font-size: 18px; cursor: pointer;
  color: var(--text);
}
.settings-section { margin-bottom: var(--space-xl); }
.settings-label { font-size: 12px; font-weight: 700; text-transform: uppercase;
  opacity: .6; margin: 0 0 var(--space-s); }
.settings-toggle { display: flex; gap: var(--space-s); flex-wrap: wrap; }
.settings-toggle button {
  flex: 1; padding: var(--space-s) var(--space-m);
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-surface); color: var(--text);
  cursor: pointer; font-size: 14px;
}
.settings-toggle button.active {
  background: var(--color-primary); color: #fff; border-color: var(--color-primary);
}
.settings-help-link {
  display: inline-block; font-size: 14px; color: var(--color-primary);
  text-decoration: none;
}
.settings-help-link:hover { text-decoration: underline; }

/* Handedness overlay */
.hand-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
}
.hand-overlay.hidden { display: none; }
.hand-box {
  background: var(--bg); border-radius: 16px;
  padding: var(--space-xl); max-width: 340px; width: 90%;
  text-align: center;
}
.hand-box h2 { margin: 0 0 var(--space-s); }
.hand-box p  { margin: 0 0 var(--space-xl); color: var(--text-muted); font-size: 14px; }
.hand-choices { display: flex; gap: var(--space-m); margin-bottom: var(--space-m); }
.hand-choice-btn {
  flex: 1; padding: var(--space-l); font-size: 16px; font-weight: 700;
  border: 2px solid var(--border); border-radius: 12px;
  background: var(--bg-surface); color: var(--text); cursor: pointer;
}
.hand-choice-btn:hover { border-color: var(--color-primary); }
.hand-skip {
  background: none; border: none; color: var(--text-muted);
  font-size: 13px; cursor: pointer; text-decoration: underline;
}

/* Icon buttons (topbar) */
.icon-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-surface); color: var(--text);
  cursor: pointer; font-size: 16px; flex-shrink: 0;
}
.icon-btn:hover { background: var(--border); }

/* Shared buttons */
.ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, filter .15s ease;
}
.ui-btn:hover,
.ui-btn:focus-visible {
  outline: none;
  border-color: rgba(59,130,246,.45);
  filter: brightness(1.03);
}
.ui-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}
.ui-btn--primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.ui-btn--secondary {
  background: var(--bg-surface);
  border-color: var(--border);
  color: var(--text);
}
.ui-btn--danger {
  background: rgba(239,68,68,.10);
  border-color: rgba(239,68,68,.42);
  color: var(--color-danger);
}
.ui-btn--pill {
  border-radius: 999px;
}
.ui-btn--compact {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}
.ui-btn--danger:hover,
.ui-btn--danger:focus-visible {
  border-color: var(--color-danger);
}
.ui-btn--primary:hover,
.ui-btn--primary:focus-visible {
  border-color: var(--color-primary);
}

/* Shared drag grip handle */
.grip-handle-shell {
  position: relative;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}
.grip-handle,
.grip-handle-hole {
  position: absolute;
  inset: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}
.grip-handle {
  border: 1px solid rgba(127,127,127,.35);
  background: var(--bg-surface);
  color: var(--text);
  cursor: grab;
  touch-action: none;
}
.grip-handle:active {
  cursor: grabbing;
}
.grip-handle-hole {
  display: none;
  border: 2px dashed #c7c7cc;
  background: transparent;
  color: #c7c7cc;
}
.grip-icon {
  width: 22px;
  height: 22px;
  display: block;
}

/* Topbar rows */
.topbar-row1 {
  display: flex; align-items: center;
  justify-content: space-between; gap: var(--space-m);
  margin-bottom: var(--space-s);
}
.topbar-left { display: flex; align-items: center; gap: var(--space-m); flex: 1; min-width: 0; }
.topbar-icons { display: flex; align-items: center; gap: var(--space-s); flex-shrink: 0; }
.topbar-row2 {
  display: flex; align-items: center; gap: var(--space-s);
  flex-wrap: wrap; margin-bottom: var(--space-m);
}

/* Fullscreen bar */
.fullscreen-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-m); padding: var(--space-s) 0 var(--space-m);
}
.fullscreen-bar[hidden] { display: none; }
.fs-actions { display: flex; align-items: center; gap: var(--space-s); }

/* Homepage header */
.homepage-header {
  display: flex; align-items: center; gap: var(--space-l);
  margin-bottom: var(--space-xl);
}
.home-logo { width: 64px; height: 64px; object-fit: contain; flex-shrink: 0; }
.home-tagline { flex: 1; }
.home-tagline-main { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.2; }
.home-tagline-sub  { margin: 0; font-size: 14px; color: var(--text-muted); }
.hand-left .homepage-header { flex-direction: row-reverse; }

/* pre-group-only: widoczne tylko gdy body.no-token */
.has-token .pre-group-only { display: none !important; }

/* Fullscreen mode */
body.fullscreen .topbar-row2   { display: none !important; }
body.fullscreen .topbar-row1   { display: none !important; }
body.fullscreen .addbox        { display: none !important; }
body.fullscreen .handle        { display: none !important; }
body.fullscreen #participants-bar { display: none !important; }
body.fullscreen .split-btn,
body.fullscreen .end-split-btn,
body.fullscreen .random-split-btn { display: none !important; }
