/* Odbijanka in the AleGry look: paper background, ink outlines, hard shadows; the board is a canvas. */
:root {
  --paper: #FFF7EA;
  --ink: #1D1533;
  --muted: #574D6E;
  --primary: #D93D22;
  --lemon: #FFD23F;
  --lemon-light: #FFF3C4;
  --sky-light: #E3F4FF;
  --line: 3px solid var(--ink);
  --radius: 18px;
  --radius-sm: 10px;
  --font-heading: 'Fredoka', 'Trebuchet MS', 'Segoe UI', sans-serif;
  --font-body: 'Nunito', 'Segoe UI', Verdana, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { background: var(--paper); color: var(--ink); }
body { margin: 0; padding: 4px 8px 12px 4px; font: 16px/1.5 var(--font-body); }
h2 { font-family: var(--font-heading); line-height: 1.15; }
:focus-visible { outline: 3px solid #7A5CFA; outline-offset: 2px; }
.notice { margin: 1rem; padding: .75rem 1rem; border: 2px solid var(--ink); border-radius: var(--radius-sm); background: var(--lemon-light); }

.button { font: 700 1rem var(--font-heading); padding: .6rem 1.1rem; border: var(--line); border-radius: 999px; background: var(--primary); color: #fff; box-shadow: 3px 3px 0 var(--ink); cursor: pointer; }
.button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.button--ghost { background: #fff; color: var(--ink); }
.button--small { font-size: .9rem; padding: .4rem .85rem; box-shadow: 2px 2px 0 var(--ink); }

.board { background: #fff; border: var(--line); border-radius: var(--radius); box-shadow: 5px 5px 0 var(--ink); overflow: hidden; }
.board__bar { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; padding: .7rem 1rem; background: var(--sky-light); border-bottom: var(--line); }
.board__bar p { margin: 0; }
.board__counters { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-weight: 700; font-size: .9rem; }
.board__counters strong { font: 700 1.1rem var(--font-heading); }

.screen { position: relative; margin: .75rem .75rem 0; border: var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--paper); }
.screen canvas { display: block; width: 100%; height: auto; aspect-ratio: 640 / 480; touch-action: none; cursor: none; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: .75rem; background: rgba(29, 21, 51, .45); overflow: auto; }
.overlay__box { width: min(100%, 30rem); padding: 1.1rem 1.25rem; border: var(--line); border-radius: var(--radius); background: #fff; box-shadow: 5px 5px 0 var(--ink); text-align: center; }
.overlay__box h2 { margin: 0 0 .4rem; font-size: 1.6rem; }
.overlay__box p { margin: 0 0 .8rem; }
.overlay__actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin: 0 !important; }
.keys { margin: .6rem 1rem 1rem; text-align: center; font-size: .85rem; color: var(--muted); }

.mg-toast { position: fixed; left: 50%; top: 1rem; z-index: 50; max-width: calc(100% - 2rem); transform: translate(-50%, -6rem); visibility: hidden; padding: .6rem 1.1rem; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 800; text-align: center; transition: transform .25s ease, visibility .25s; }
.mg-toast.is-visible { transform: translate(-50%, 0); visibility: visible; }

/* On a phone the boxes go below the board instead of covering it. */
@media (max-width: 640px) {
  .board__bar { padding: .6rem .75rem; }
  .screen { margin: .6rem .4rem 0; overflow: visible; border: 0; }
  .screen canvas { border: var(--line); border-radius: var(--radius-sm); }
  .overlay { position: static; background: none; padding: .75rem 0 0; }
  .overlay__box { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
