@font-face { font-family: "Lilita"; src: url("../fonts/LilitaOne-Regular.ttf") format("truetype"); font-display: block; }
:root {
  --wood: #8a5a2b; --wood-dark: #4d2f12; --wood-light: #c58a4a;
  --paper: #fbf1d6; --ink: #3a2410; --red: #c8261d; --gold: #ffd23a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #1b140c; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
body { font-family: "Lilita", "Trebuchet MS", sans-serif; color: var(--ink); }
#stage { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
canvas { display: block; cursor: none; }
.screen { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; cursor: default; }
.screen.hidden, .hidden { display: none !important; }
.board {
  background: linear-gradient(#fdf5df, #f1dfb3); border: 6px solid var(--wood); border-radius: 18px;
  box-shadow: 0 0 0 3px var(--wood-dark), 0 14px 40px rgba(0,0,0,.55), inset 0 0 30px rgba(140,90,40,.25);
  padding: 22px 30px; max-width: 520px; width: 100%; text-align: center; max-height: 100%; overflow: auto;
}
.board.wide { max-width: 620px; }
h1 { margin: 0 0 4px; font-size: clamp(34px, 7vw, 58px); line-height: .95; font-weight: normal; letter-spacing: .5px; }
h1 span { display: inline-block; -webkit-text-stroke: 2px var(--wood-dark); paint-order: stroke fill; text-shadow: 3px 4px 0 rgba(0,0,0,.25); }
h1 .t1 { color: #1f3a5a; } h1 .t2 { color: #f08a1c; } h1 .t3 { color: var(--gold); display: block; }
h2 { margin: 0 0 14px; font-size: 38px; font-weight: normal; color: var(--red); -webkit-text-stroke: 1.5px var(--wood-dark); paint-order: stroke fill; }
.sub { margin: 6px 0 18px; font-size: 19px; color: var(--wood); }
.buttons { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.buttons.inline { flex-direction: row; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
button {
  font: inherit; font-size: 20px; color: #fff; cursor: pointer; padding: 8px 22px; min-width: 210px;
  background: linear-gradient(#d4934f, #8a5a2b); border: 3px solid var(--wood-dark); border-radius: 12px;
  -webkit-text-stroke: 1px var(--wood-dark); paint-order: stroke fill; box-shadow: 0 4px 0 var(--wood-dark);
}
button:hover { filter: brightness(1.12); }
button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--wood-dark); }
button.big { font-size: 28px; background: linear-gradient(#ff6b4a, #c8261d); }
button.tiny { min-width: 0; font-size: 15px; padding: 4px 12px; }
.row.small { margin-top: 16px; display: flex; gap: 10px; justify-content: center; }
.help { text-align: left; font-family: "Trebuchet MS", sans-serif; font-size: 16px; line-height: 1.45; padding-left: 20px; margin: 0 0 16px; }
.help b { font-family: "Lilita", sans-serif; font-weight: normal; color: var(--red); }
.tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 10px; }
.tab { min-width: 0; font-size: 16px; padding: 4px 14px; background: linear-gradient(#bfa27c, #8c7356); }
.tab.on { background: linear-gradient(#d4934f, #8a5a2b); }
ol.hiscore { list-style: none; margin: 0 auto 14px; padding: 0; max-width: 460px; font-size: 20px; }
ol.hiscore li { display: grid; grid-template-columns: 2.2em 1fr auto; gap: 8px; padding: 3px 8px; border-bottom: 2px dashed rgba(138,90,43,.35); text-align: left; }
ol.hiscore li .r { color: var(--wood); }
ol.hiscore li .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ol.hiscore li .s { color: var(--red); }
ol.hiscore li.me { background: rgba(255,210,58,.55); border-radius: 6px; }
ol.hiscore li.empty { display: block; text-align: center; color: var(--wood); }
.final { font-size: 52px; color: var(--red); -webkit-text-stroke: 1.5px var(--wood-dark); paint-order: stroke fill; }
.final span:last-child { font-size: 26px; color: var(--wood); -webkit-text-stroke: 0; }
.stats { font-family: "Trebuchet MS", sans-serif; font-size: 16px; margin: 4px 0 12px; color: var(--wood-dark); }
.submit { display: flex; gap: 8px; justify-content: center; margin-bottom: 8px; flex-wrap: wrap; }
.submit input { font: inherit; font-size: 20px; padding: 6px 12px; border: 3px solid var(--wood); border-radius: 10px; background: #fffaf0; color: var(--ink); width: 230px; }
.submit button { min-width: 0; }
.msg { min-height: 1.3em; font-family: "Trebuchet MS", sans-serif; font-size: 15px; margin-bottom: 6px; color: var(--wood-dark); }
#touch-reload { position: absolute; right: 14px; bottom: 90px; min-width: 0; font-size: 18px; opacity: .85; }
#version { position: absolute; left: 8px; bottom: 4px; font: 11px "Trebuchet MS", sans-serif; color: rgba(255,255,255,.55); pointer-events: none; }
