:root {
  --bg: #0e0f12;
  --panel: #151821;
  --text: #e7e9ee;
  --muted: #9aa3b2;
  --accent: #5cc8ff;
}

@font-face {
  font-family: 'Comic Runes Font';
  src: url('ComicRunes.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: #000;
  background: #fff;
}

#stage { position: relative; display: inline-block; border-radius: 20px; overflow: hidden; }
canvas#board {
  display: block;
  margin: 0;
  background: transparent;
  border-radius: 20px;
  box-shadow: none;
  overflow: hidden;
  touch-action: none;
}
canvas#next {
  display: block;
  margin: 0;
  background: transparent !important;
  border: 0 !important;
  outline: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.5);
}

.overlay.hidden { display: none; }

.overlay .message {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 20px;
  color: var(--text);
  text-align: center;
  opacity: 0.9;
}

/* legacy restart button styles removed in favor of unified .ui-button */

/* sidebar removed */

.sidebar h1 {
  margin: 2px 0 8px 0;
  font-size: 24px;
  letter-spacing: 0.5px;
}

.stat {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.06);
}
.stat label { color: var(--muted); }
.stat span { font-variant-numeric: tabular-nums; }

.next { margin-top: 12px; }
.next label { color: var(--muted); display: block; margin-bottom: 6px; }

canvas#next {
  display: block;
  background: var(--panel);
  border-radius: 10px;
  width: 128px;
  height: 128px;
  image-rendering: pixelated;
}

.help { color: var(--muted); font-size: 12px; margin-top: 16px; line-height: 1.4; }

/* remove responsive scaling to keep canvas pinned at top-left */


/* UI Overlay and Buttons */
.ui-overlay { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.ui-overlay.hidden { display: none; }
.ui-overlay.visible { pointer-events: none; } /* Keep overlay transparent to clicks */
.ui-buttons { display: flex; gap: 8px; flex-direction: column; align-items: center; pointer-events: none; }

.ui-button {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  background-color: #f0f0f0;
  border: 0;
  color: #242424;
  border-radius: 0.5em;
  font-size: 0.875rem; /* 30% smaller than previous 1.25rem */
  padding: 0.375em 1em;
  font-weight: 600;
  text-shadow: 0 0.0625em 0 #fff;
  box-shadow: inset 0 0.0625em 0 0 #f4f4f4, 0 0.0625em 0 0 #efefef,
    0 0.125em 0 0 #ececec, 0 0.25em 0 0 #e0e0e0, 0 0.3125em 0 0 #dedede,
    0 0.375em 0 0 #dcdcdc, 0 0.425em 0 0 #cacaca, 0 0.425em 0.5em 0 #cecece;
  transition: 0.25s ease;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  cursor: pointer;
  pointer-events: auto; /* Allow buttons to be clickable even when overlay is transparent */
}

/* Start button uses previous larger size */
#startBtn.ui-button { font-size: 1.125rem; }


/* Half press on hover */
.ui-button:hover {
  transform: translateY(0.1125em);
  box-shadow: inset 0 0.045em 0 0 #f4f4f4, 0 0.045em 0 0 #efefef,
    0 0.09em 0 0 #ececec, 0 0.18em 0 0 #e0e0e0, 0 0.2em 0 0 #dedede,
    0 0.25em 0 0 #dcdcdc, 0 0.275em 0 0 #cacaca, 0 0.275em 0.45em 0 #cecece;
}

/* Full press on active */
.ui-button:active {
  transform: translateY(0.225em);
  box-shadow: inset 0 0.03em 0 0 #f4f4f4, 0 0.03em 0 0 #efefef,
    0 0.0625em 0 0 #ececec, 0 0.125em 0 0 #e0e0e0, 0 0.125em 0 0 #dedede,
    0 0.2em 0 0 #dcdcdc, 0 0.225em 0 0 #cacaca, 0 0.225em 0.375em 0 #cecece;
}

.ui-button::after {
  position: absolute;
  content: "";
  display: block;
  width: 100%;
  height: calc(100% + 0.375em);
  top: 0;
  left: 0;
  background-color: transparent;
  transition: height 0.25s ease;
}

.ui-button:hover::after { height: calc(100% + 0.3em); }
.ui-button:active::after { height: calc(100% + 0.225em); }

#jobBtn { margin-top: -41px; margin-left: 15px; font-size: 1.03788rem; } /* moved up 41px, right 15px, 7% smaller */
#restartBtn { margin-top: -10px; font-size: 0.74375rem; }
