@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
  user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg:      #0a0e1a;
  --panel:   #111827;
  --border:  #1e3050;
  --left:    #1976d2;
  --left-dk: #0d47a1;
  --right:   #e53935;
  --right-dk:#b71c1c;
  --ice:     #d6eef8;
  --text:    #c8dff0;
  --accent:  #4fc3f7;
}

html, body {
  width: 100%; height: 100%;
  background: var(--bg);
  font-family: 'Share Tech Mono', monospace;
  color: var(--text);
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ── Toolbar ────────────────────────────────── */
#toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 10px;
  background: var(--panel);
  border-bottom: 2px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.team-strip {
  display: flex;
  align-items: center;
  gap: 5px;
}

.team-badge {
  font-size: .72em;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 0 4px;
}
.left-badge  { color: #90caf9; }
.right-badge { color: #ef9a9a; }

.mode-strip {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
}

.tb-sep {
  width: 1px; height: 24px;
  background: var(--border);
  margin: 0 2px;
}

/* generic toolbar button */
.tb-btn {
  padding: 5px 11px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: .78em;
  font-weight: 700;
  transition: filter .15s, transform .1s;
}
.tb-btn:active { transform: scale(.94); }

.goalie-btn { background: #6a1b9a; color: #e1bee7; }
.goalie-btn:hover { filter: brightness(1.25); }

.add-btn    { background: #00695c; color: #b2dfdb; }
.add-btn:hover { filter: brightness(1.3); }

.rem-btn    { background: #b71c1c; color: #ffcdd2; }
.rem-btn:hover { filter: brightness(1.3); }

.reset-btn  { background: #e65100; color: #ffe0b2; }
.reset-btn:hover { filter: brightness(1.25); }

.clear-btn  { background: #37474f; color: #cfd8dc; }
.clear-btn:hover { filter: brightness(1.3); }

.undo-btn   { background: #4527a0; color: #d1c4e9; }
.undo-btn:hover { filter: brightness(1.3); }

/* mode buttons */
.mode-btn {
  padding: 5px 13px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: #6b8aaa;
  cursor: pointer;
  font-family: inherit;
  font-size: .78em;
  font-weight: 700;
  transition: all .15s;
}
.mode-btn:hover { border-color: var(--accent); color: var(--accent); }
.mode-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0e1a;
}
.mode-btn.play-btn.active {
  background: #69f0ae;
  border-color: #69f0ae;
  color: #0a0e1a;
}

/* ── Canvas area ────────────────────────────── */
#canvas-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  position: relative;
}

#board {
  border-radius: 6px;
  touch-action: none;
  cursor: grab;
  display: block;
}
#board.cur-crosshair { cursor: crosshair; }
#board.cur-pointer   { cursor: pointer; }
#board.cur-default   { cursor: default; }
#board.cur-grabbing  { cursor: grabbing; }

/* hint bar at bottom of canvas */
#hint {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: .72em;
  padding: 4px 14px;
  border-radius: 12px;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .3s;
}
#hint.visible { opacity: 1; }

/* portrait rotation nudge */
#rotate-msg {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 200;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  font-size: 1.1em;
  text-align: center;
  padding: 24px;
}
@media (orientation: portrait) and (max-width: 840px) {
  #rotate-msg { display: flex; }
}
