:root {
  --bg: #0e1322;
  --panel: #161d33;
  --panel-2: #1f2942;
  --text: #e7ecf6;
  --muted: #8a93ad;
  --accent: #ffd23f;
  --accent-2: #29d39a;
  --loss: #ff5c7a;
  --win: #29d39a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid #232d4a;
}

header h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sound-toggle {
  background: var(--panel-2);
  border: 1px solid #2c375a;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 16px;
  line-height: 1;
}

.sound-toggle.off {
  opacity: 0.5;
}

.balance {
  font-size: 16px;
  color: var(--muted);
}

.balance span {
  color: var(--accent);
  font-weight: 700;
}

main {
  display: flex;
  gap: 24px;
  padding: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.board-area {
  background: var(--panel);
  border-radius: 14px;
  padding: 16px;
  flex-shrink: 0; /* don't let the panel squish the board */
}

#board {
  display: block;
  background: var(--panel);
  border-radius: 10px;
  width: 640px;
  max-width: 100%;
  height: auto; /* stay square if it ever has to shrink */
  aspect-ratio: 1 / 1;
}

.panel {
  flex: 1;
  min-width: 280px;
  background: var(--panel);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.controls input,
.controls select {
  background: var(--panel-2);
  border: 1px solid #2c375a;
  color: var(--text);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 14px;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 15px;
  font-weight: 700;
}

#drop {
  grid-column: 1 / -1;
  background: var(--accent-2);
  color: #062b20;
}

#drop:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.secondary {
  grid-column: 1 / -1;
  background: var(--panel-2);
  color: var(--text);
  font-weight: 600;
}

button.link {
  background: none;
  color: var(--muted);
  padding: 0;
  font-size: 12px;
  font-weight: 500;
}

.control-box {
  background: var(--panel-2);
  border: 1px solid #2c375a;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.control-box h2 {
  margin: 0;
  font-size: 15px;
}

.control-box .hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.control-box label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.control-box select {
  background: var(--panel);
  border: 1px solid #2c375a;
  color: var(--text);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 14px;
}

.control-box .secondary {
  background: var(--panel);
}

.rtp-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rtp-fields input {
  background: var(--panel);
  border: 1px solid #2c375a;
  color: var(--text);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 14px;
}

.control-status {
  font-size: 12px;
  color: var(--accent);
  min-height: 14px;
}

.control-stats {
  font-size: 12px;
  color: var(--muted);
  min-height: 14px;
}

.log-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.log-header h2 {
  margin: 0;
  font-size: 15px;
}

.log {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel-2);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  border-left: 4px solid #2c375a;
}

.log li .mult {
  font-weight: 800;
  font-size: 15px;
}

.log li.win {
  border-left-color: var(--win);
}

.log li.loss {
  border-left-color: var(--loss);
}

.log li.win .mult {
  color: var(--win);
}

.log li.loss .mult {
  color: var(--loss);
}

.log li .meta {
  color: var(--muted);
  text-align: right;
  font-size: 12px;
}

.empty {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 12px;
}
