/* Shared look for every page of the Twirly Tiles website: the app's wood and paint. */
:root {
  --birch: #E6C089;
  --birch-light: #F0D4A4;
  --birch-edge: #C4924F;
  --groove: #7A4B22;
  --ink: #3A2313;
  --ink-soft: #76512F;
  --red: #E2402F;
  --red-side: #B83223;
  --blue: #2361D3;
  --yellow: #F7BD22;
  --yellow-side: #C99512;
  --green: #3F9E46;
  --card: rgba(255, 240, 210, 0.45);
  --card-strong: rgba(255, 240, 210, 0.7);
}
* { box-sizing: border-box; margin: 0; }
html, body { min-height: 100%; }
body {
  font-family: 'Grandstander', system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--birch);
  /* Wood grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 900' preserveAspectRatio='none'%3E%3Cg fill='none' stroke='rgba(122,75,34,0.10)' stroke-width='2.5'%3E%3Cpath d='M0 60 C240 30 420 95 720 62 S1200 30 1440 70'/%3E%3Cpath d='M0 150 C300 175 520 120 820 150 S1250 185 1440 140'/%3E%3Cpath d='M0 245 C200 220 460 270 760 240 S1180 215 1440 255'/%3E%3Cpath d='M0 340 C260 365 560 310 860 345 S1260 370 1440 330'/%3E%3Cpath d='M0 430 C220 405 480 455 780 425 S1220 400 1440 445'/%3E%3Cpath d='M0 525 C280 550 540 500 840 530 S1240 560 1440 515'/%3E%3Cpath d='M0 615 C240 590 470 640 770 610 S1190 585 1440 630'/%3E%3Cpath d='M0 710 C300 735 560 685 860 715 S1270 740 1440 700'/%3E%3Cpath d='M0 805 C230 780 490 830 790 800 S1210 775 1440 820'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 100% 100vh;
  background-attachment: fixed;
  overflow-x: hidden;
}
a { color: inherit; }
.wrap { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---- Header ---- */
.site-header { position: relative; z-index: 5; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; padding-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 900; font-size: 22px; }
.brand svg { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 3px 0 var(--birch-edge); }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a { text-decoration: none; font-weight: 700; font-size: 16px; padding: 8px 12px; border-radius: 12px; }
.nav a:hover { background: var(--card); }
.nav a[aria-current='page'] { background: var(--card-strong); }

/* ---- Footer ---- */
.site-footer { position: relative; z-index: 1; padding: 36px 16px 28px; text-align: center; font-size: 14px; color: var(--ink-soft); }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-bottom: 8px; }
.site-footer a { text-decoration: none; font-weight: 700; }
.site-footer a:hover { text-decoration: underline; }

/* ---- Type ---- */
h1 { font-weight: 900; font-size: clamp(40px, 6vw, 68px); line-height: 1; letter-spacing: -0.5px; text-shadow: 0 2px 0 rgba(255, 240, 210, 0.7); }
h2 { font-weight: 900; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.1; }
h3 { font-weight: 800; font-size: 22px; }
.lead { font-weight: 500; font-size: 19px; line-height: 1.5; color: var(--ink-soft); }
.muted { color: var(--ink-soft); font-weight: 500; }
.small { font-size: 14px; }
.center { text-align: center; }

/* ---- Wooden blocks (buttons) ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border: 0; border-radius: 14px;
  font: 800 18px 'Grandstander', system-ui, sans-serif; text-decoration: none; cursor: pointer;
  color: #fff; background: var(--red); box-shadow: 0 5px 0 var(--red-side);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 0 var(--red-side); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--red-side); }
.btn:focus-visible, input:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.btn.yellow { color: var(--ink); background: var(--yellow); box-shadow: 0 5px 0 var(--yellow-side); }
.btn.wood { color: var(--ink); background: var(--birch-light); box-shadow: 0 5px 0 var(--birch-edge); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: default; transform: none; }
.link-btn { background: none; border: 0; padding: 8px; font: 700 15px 'Grandstander', system-ui, sans-serif; color: var(--ink); text-decoration: underline; cursor: pointer; }
.link-btn.danger { color: var(--red); }

/* ---- Cards ---- */
.card { background: var(--card); border-radius: 20px; padding: 22px; }
.card.strong { background: var(--card-strong); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---- Forms ---- */
label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
input[type='email'], input[type='text'], input[type='number'] {
  width: 100%; padding: 12px 14px; border: 2px solid var(--ink-soft); border-radius: 12px;
  font: 700 18px 'Grandstander', system-ui, sans-serif; color: var(--ink); background: rgba(255, 240, 210, 0.6);
}
input.code { letter-spacing: 8px; text-align: center; }
.form-row { margin-top: 14px; }
.error { color: var(--red); font-weight: 700; margin-top: 10px; }
.ok { color: var(--green); font-weight: 700; }

/* ---- Dialog ---- */
dialog {
  width: min(440px, calc(100% - 32px)); border: 0; border-radius: 22px; padding: 26px;
  background: var(--birch-light); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(58, 35, 19, 0.6);
}
dialog::backdrop { background: rgba(58, 35, 19, 0.45); }
.dialog-close { position: absolute; top: 12px; right: 14px; }

/* ---- Bits ---- */
.check-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; }
.check-list li::before { content: '✓'; color: var(--green); font-weight: 900; }
.price { font-weight: 900; font-size: 40px; }
.price s { font-size: 20px; color: var(--ink-soft); font-weight: 700; margin-right: 6px; }
.price small { font-size: 16px; font-weight: 700; }
.tag { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 800; background: var(--yellow); }
.notice { background: var(--card-strong); border-left: 6px solid var(--yellow); border-radius: 12px; padding: 12px 14px; font-weight: 600; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid rgba(122, 75, 34, 0.18); font-size: 15px; }
th { font-weight: 800; }
td { font-weight: 500; }
.table-scroll { overflow-x: auto; }
.prose { max-width: 720px; }
.prose h2 { margin-top: 28px; font-size: 24px; }
.prose p, .prose li { margin-top: 10px; font-weight: 500; line-height: 1.6; }
.prose ul { padding-left: 20px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--card-strong); border-top-color: var(--red); animation: spin 0.8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
[hidden] { display: none !important; }

@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .nav a { padding: 8px 8px; font-size: 15px; }
  .brand { font-size: 19px; gap: 8px; }
  .brand svg { width: 32px; height: 32px; }
}
