/*
   The dartboard.
   Loaded in order with the others (see index.html): a later rule wins. */

/* DARTBOARD */

.dartboard-section {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 62%;
	max-width: 62%;
}

/* Over a dart (once they can be tapped): a pointer. */
#dartboard.on-mark {
	cursor: pointer;
}

/* Over the board: a white crosshair outlined in black, visible on any bed. */
#dartboard.aiming {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cg stroke-linecap='round'%3E%3Cpath d='M12 2v7M12 15v7M2 12h7M15 12h7' stroke='black' stroke-width='4'/%3E%3Cpath d='M12 2v7M12 15v7M2 12h7M15 12h7' stroke='white' stroke-width='2'/%3E%3C/g%3E%3Ccircle cx='12' cy='12' r='1.6' fill='white' stroke='black'/%3E%3C/svg%3E") 12 12, crosshair;
}

/* The board's place. The SVG has a 1% margin for the outline, hence × 1.01. */
/* The board's edge stands in from the screen's top and bottom as far as the
   buttons do from its edges (the drawing has a 1% margin round the board). */
.board-frame {
	position: relative;
	width: calc(min(99%, 100vmin - 2 * var(--side-pad)) * 1.01);
	aspect-ratio: 1;
	margin-right: -0.25vmin;
}

/* The board's shadow, on a plain circle behind it (the board's edge, inside
   the 1% margin). A drop-shadow filter on the board itself blurred the whole
   board again every time anything on it changed, the pointer's light
   included, which was slow on integrated graphics. This is drawn once.
   A faint light rim on top of it keeps the edge from melting into the dark
   background when the outline is set to black. */
.board-frame::before {
	content: '';
	position: absolute;
	inset: 0.495%;
	border-radius: 50%;
	box-shadow: 0 0 0 0.15vmin rgba(255, 255, 255, 0.15), 0 0 1.2vmin rgba(255, 255, 255, 0.22), 0 0 4vmin black;
	pointer-events: none;
}

/* Drawn in js/dartboard.js. */
#dartboard {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible; /* darts lean out past the board, and fly in from beyond it */
	pointer-events: auto;
	-webkit-tap-highlight-color: transparent;
}

.seg {
	fill-rule: evenodd; /* the outer bull is a ring around the bull */
	stroke: var(--board-seam);
	stroke-width: 0.3;
	stroke-linejoin: round;
}

.seg.black { fill: var(--board-black); }
.seg.white { fill: var(--board-white); }
.seg.red { fill: var(--board-red); }
.seg.green { fill: var(--board-green); }
.seg.legend { fill: var(--board-legend); stroke: none; }

/* Optional wires around every bed (Settings > Board layout). Not round the
   number ring: its outer edge is the board's edge, where the outline is, and
   a wire there thickened it. */
.beds.wired .seg:not(.legend) {
	stroke: var(--wire);
	stroke-width: var(--wire-width);
}

.numbers text {
	fill: var(--board-number);
	font-family: var(--font);
	font-weight: 400;
	text-anchor: middle;
	dominant-baseline: central;
}
