* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

h1 {
  text-align: center;
  margin-bottom: 20px;
  color: #00d4ff;
}

h2 {
  margin-bottom: 12px;
  color: #00d4ff;
  font-size: 1rem;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 1024px) {
  .grid { grid-template-columns: 1fr; }
}

.card {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 8px;
  padding: 16px;
}

.card.wide {
  margin-bottom: 16px;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.form-row label {
  font-size: 0.85rem;
  color: #aaa;
  min-width: 80px;
}

input, select {
  background: #0f3460;
  border: 1px solid #1a4080;
  color: #e0e0e0;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.9rem;
  flex: 1;
}

button {
  background: #e94560;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
}

button:hover { background: #c73652; }
button:active { transform: scale(0.97); }
button.secondary { background: #555; }
button.secondary:hover { background: #666; }
button.active { background: #8bc34a; }
button.active:hover { background: #7ab32e; }
button:disabled { background: #555; cursor: not-allowed; }
button:disabled:hover { background: #555; }
button:disabled:active { transform: scale(1); }

.btn-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.balance {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 8px;
  font-family: 'Courier New', monospace;
}

.result {
  margin-top: 8px;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: #8bc34a;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 120px;
  overflow-y: auto;
}

.result.error { color: #e94560; }

/* Dice grid */
.dice-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-bottom: 12px;
}

.dice-cell {
  background: #0f3460;
  border: 2px solid #1a4080;
  border-radius: 4px;
  padding: 8px 4px;
  text-align: center;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: 'Courier New', monospace;
  transition: all 0.15s;
  user-select: none;
}

.dice-cell:hover {
  border-color: #00d4ff;
}

.dice-cell.selected {
  background: #e94560;
  border-color: #e94560;
  color: white;
}

.bet-info {
  display: flex;
  gap: 20px;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.bet-info strong { color: #00d4ff; }

/* WebSocket */
.ws-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

#wsStatus { color: #e94560; }
#wsStatus.connected { color: #8bc34a; }

/* Logs */
.log {
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  background: #0a0a1a;
  border: 1px solid #1a1a3e;
  border-radius: 4px;
  padding: 8px;
  max-height: 250px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-entry { margin-bottom: 4px; padding-bottom: 4px; border-bottom: 1px solid #1a1a3e; }
.log-entry .ts { color: #666; }
.log-entry .dir-in { color: #00d4ff; }
.log-entry .dir-out { color: #ffa726; }
.log-entry .method { color: #ce93d8; }

@media (max-width: 768px) {
  .grid { grid-template-columns: 1fr; }
}

/* Player list */
.player-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #0f3460;
}
.player-row:last-child { border-bottom: none; }
.player-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  min-width: 180px;
}
.player-row input[type="radio"] {
  background: transparent;
  border: none;
  padding: 0;
  flex: none;
  width: auto;
}
.player-id {
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
}
.player-balance {
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: #8bc34a;
  min-width: 120px;
}
.player-balance.error { color: #e94560; }
