:root {
  --bg: #0d1117; --card: #161b22; --border: #30363d;
  --text: #c9d1d9; --red: #da3633; --blue: #2f81f7; --green: #238636;
  --gray: #21262d; --yellow: #d29922;
}

body { 
  font-family: system-ui, sans-serif; 
  background: var(--bg); 
  color: var(--text); 
  padding: 20px; 
  display: flex; 
  justify-content: center; 
}

.card { 
  background: var(--card); 
  border: 1px solid var(--border); 
  border-radius: 8px; 
  padding: 20px; 
  width: 100%; 
  max-width: 680px; 
  text-align: center; 
}

.btn { 
  background: var(--blue); 
  color: white; 
  border: none; 
  padding: 10px 15px; 
  border-radius: 6px; 
  font-weight: bold; 
  cursor: pointer; 
  width: 100%; 
  margin-top: 10px; 
}

.btn-red { background: var(--red); }
.btn-green { background: var(--green); }

input { 
  width: 90%; 
  padding: 10px; 
  margin: 10px 0; 
  background: #090d16; 
  border: 1px solid var(--border); 
  color: white; 
  border-radius: 6px; 
  text-align: center; 
}

/* Pasek nawigacyjny u góry gracza */
.nav-bar {
  display: flex;
  justify-content: space-between;
  background: #090d16;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px;
  margin-bottom: 15px;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.75em;
  font-weight: bold;
  padding: 8px 6px;
  border-radius: 4px;
  cursor: pointer;
  flex: 1;
  text-align: center;
  transition: all 0.2s;
}

.nav-btn.active {
  background: var(--blue);
  color: white;
}

/* Przycisk na środku stołu */
.center-toggle-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  background: #090d16;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.7em;
  font-weight: bold;
  padding: 6px 10px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  transition: all 0.2s;
  white-space: nowrap;
}

.center-toggle-btn:hover {
  border-color: var(--blue);
  color: white;
  background: #161b22;
}

/* Style dla sekwencji nocy */
.night-guide {
  text-align: left;
  max-height: 430px;
  overflow-y: auto;
  padding-right: 5px;
}
.night-step {
  background: #090d16;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 8px;
  font-size: 0.85em;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.night-step span {
  background: var(--blue);
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8em;
  font-weight: bold;
  flex-shrink: 0;
}

/* Style dla Księgi Ról */
.role-category-title {
  font-size: 1.1em;
  font-weight: bold;
  margin: 15px 0 8px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.role-item {
  background: #090d16;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 8px;
}
.role-item-name {
  font-weight: bold;
  font-size: 0.95em;
}
.role-item-desc {
  font-size: 0.8em;
  color: #8b949e;
  margin-top: 4px;
}

.badge { 
  padding: 4px 8px; 
  border-radius: 12px; 
  font-weight: bold; 
  font-size: 0.8em; 
  display: inline-block;
  margin-top: 5px;
}

.badge-red { background: var(--red); color: white; box-shadow: 0 0 10px rgba(218, 54, 51, 0.5); } 
.badge-blue { background: var(--blue); color: white; box-shadow: 0 0 10px rgba(47, 129, 247, 0.5); }
.badge-yellow { background: var(--yellow); color: black; box-shadow: 0 0 10px rgba(210, 153, 34, 0.5); }

/* Kontener stołu */
.table-container {
  position: relative;
  width: 100%;
  max-width: 580px;
  height: 380px;
  margin: 15px auto;
  border: 2px dashed rgba(48, 54, 61, 0.5);
  border-radius: 40px;
  background: radial-gradient(circle, rgba(22,27,34,0.4) 0%, rgba(9,13,22,0.8) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.table-ring {
  position: relative;
  width: 100%;
  height: 100%;
}

.player-circle {
  border-radius: 50%;
  background: var(--gray);
  border: 2px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px;
  box-sizing: border-box;
  position: absolute;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
}

.player-circle.selectable {
  border: 2px solid var(--green);
  cursor: pointer;
  background: #091a10;
}

.player-circle.selectable:hover {
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow: 0 0 12px var(--green);
  z-index: 10;
}

.player-circle.interactive-target {
  cursor: pointer;
}

.player-circle.interactive-target:hover {
  transform: translate(-50%, -50%) scale(1.1);
  border-color: var(--yellow);
  box-shadow: 0 0 10px var(--yellow);
  z-index: 10;
}

.player-circle.taken {
  border: 2px solid var(--red);
  background: #1a0909;
  opacity: 0.6;
}

.player-circle.joined {
  border: 2px solid var(--blue);
  background: #090d16;
  border-style: solid;
}

.player-circle.is-me {
  border-width: 3px !important;
  box-shadow: 0 0 15px var(--blue);
}

.player-circle.alive {
  border-color: var(--green);
}

.player-circle.dead {
  border-color: var(--red);
  opacity: 0.6;
}

.player-circle.team-blue { border-color: var(--blue) !important; box-shadow: 0 0 10px rgba(47, 129, 247, 0.5); }
.player-circle.team-red { border-color: var(--red) !important; box-shadow: 0 0 10px rgba(218, 54, 51, 0.5); }
.player-circle.team-yellow { border-color: var(--yellow) !important; box-shadow: 0 0 10px rgba(210, 153, 34, 0.5); }

.player-name {
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 90%;
  text-align: center;
}

.player-role {
  margin-top: 1px;
  text-align: center;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 90%;
}

.empty-slot {
  color: #484f58;
  font-style: italic;
  font-size: 0.75em;
}

/* Modalki */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--card);
  border: 2px solid var(--blue);
  border-radius: 12px;
  padding: 25px;
  width: 90%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 0 25px rgba(47, 129, 247, 0.4);
}

.hidden { display: none !important; }
#qrcode img { margin: 15px auto; }