:root {
  --bg: #121212;
  --board-bg: #1e1e1e;
  --tile-bg: #222;
  --tile-active: #2f3b4a;
  --tile-line: #4caf50;
  --tile-off: #555;
  --text-main: #fff;
  --text-muted: #aaa;
  --accent: #4caf50;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background: var(--bg);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.container {
  text-align: center;
  max-width: 420px;
  padding: 16px;
}

h1 {
  font-size: 2.2rem;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.score-box {
  background: #1b1b1b;
  padding: 8px 12px;
  border-radius: 6px;
  min-width: 90px;
}

.score-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #ccc;
}

.score-value {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 2px;
}

.btn {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.board {
  background: var(--board-bg);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.tile {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  background: var(--tile-bg);
  position: relative;
  cursor: pointer;
  transition: background 0.1s ease, transform 0.08s ease;
}

.tile:hover {
  background: var(--tile-active);
  transform: scale(1.03);
}

.tile-line {
  position: absolute;
  background: var(--tile-line);
}

.tile-line.off {
  background: var(--tile-off);
}

/* line segments */
.line-up,
.line-down {
  width: 8px;
  height: 50%;
  left: 50%;
  transform: translateX(-50%);
}

.line-up {
  top: 0;
}

.line-down {
  bottom: 0;
}

.line-left,
.line-right {
  height: 8px;
  width: 50%;
  top: 50%;
  transform: translateY(-50%);
}

.line-left {
  left: 0;
}

.line-right {
  right: 0;
}

.tile.start::after,
.tile.end::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: #000;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.tile.start::after {
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.8);
}

.tile.end::after {
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.message {
  margin-top: 10px;
  font-size: 0.9rem;
  color: #ddd;
  min-height: 18px;
}

@media (max-width: 480px) {
  .board {
    padding: 8px;
    gap: 6px;
  }
  .tile {
    width: 52px;
    height: 52px;
  }
}
