:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  color: #1e3a8a;
  background: #eef2f7;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  min-width: 0;
  min-height: 0;
}

button {
  min-width: 0;
  margin: 0;
  border: 0;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 64px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  color: #ffffff;
  background: #1e3a8a;
  scrollbar-width: thin;
  touch-action: manipulation;
}

.sidebar-button {
  display: flex;
  flex: 0 0 auto;
  justify-content: center;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 10px;
  color: #ffffff;
  background: transparent;
  line-height: 1;
  touch-action: manipulation;
}

.tool-button {
  flex-direction: column;
  width: 52px;
  height: 48px;
  padding: 0;
  font-size: 12px;
}

.compact-button {
  width: 52px;
  height: 40px;
  padding: 0 2px;
  font-size: 12px;
  white-space: normal;
}

.sidebar-divider {
  flex: 0 0 auto;
  width: 52px;
  height: 1px;
  margin: 6px 0;
  background: rgba(255, 255, 255, 0.3);
}

.tool-button.active {
  border-color: #ffffff;
  color: #1e3a8a;
  background: #ffffff;
}

.sidebar-button:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: -4px;
}

.court-area {
  display: grid;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #eef2f7;
  place-items: center;
}

#court-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #eef2f7;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.court-layer,
.court-layer * {
  pointer-events: none;
}

.court-floor {
  fill: #ffffff;
}

.court-line,
.paint,
.basket {
  fill: none;
  stroke: #1e3a8a;
  stroke-width: 0.08;
}

.paint {
  fill: #dbeafe;
}

.basket {
  stroke-width: 0.05;
}

.draw-line,
.arrow-head {
  fill: none;
  stroke: #263238;
  stroke-width: 0.14;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.draw-line.pass {
  stroke-dasharray: 0.35 0.25;
}

.preview-layer {
  opacity: 0.72;
  pointer-events: none;
}

.piece-hit {
  fill: transparent;
  stroke: none;
  pointer-events: all;
}

.piece-body {
  pointer-events: none;
}

.piece-number {
  font-size: 0.55px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  user-select: none;
}

.reset-button {
  white-space: normal;
}

.reset-button.armed {
  border-color: #c62828;
  color: #ffffff;
  background: #c62828;
}
