/* How the page looks: the green felt, the bar along the top, the title
   screen and the message banner. The table itself is drawn on the canvas. */

:root {
  --felt: #1b6b35;
  --felt-dark: #14522a;
  --paper: #fbf7ec;
  --ink: #24242c;
  --gold: #e8b628;
  --pixel: "Press Start 2P", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--felt);
  color: var(--paper);
  font-family: var(--pixel);
  overflow: hidden;
  /* Dragging cards shouldn't scroll, zoom or select the page. */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

button {
  font: inherit;
  font-size: 10px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  padding: 8px 10px;
  cursor: pointer;
}
button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

#bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  padding: 0 max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--felt-dark);
  font-size: 10px;
}
#bar #clock { margin-left: auto; }
#bar #moves { margin-right: auto; }

#table {
  position: fixed;
  top: 44px;
  left: 0;
  width: 100%;
  height: calc(100% - 44px);
  display: block;
}

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 40, 20, 0.82);
  padding: 16px;
}
.screen[hidden], #banner[hidden] { display: none; }

.panel {
  max-width: 420px;
  text-align: center;
  line-height: 1.6;
}
.panel h1 {
  font-size: 28px;
  color: var(--gold);
  text-shadow: 3px 3px 0 var(--ink);
  margin: 0 0 16px;
}
.panel p { font-size: 10px; margin: 12px 0; }
.panel .how { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; opacity: 0.9; }
.buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 16px 0; }
.buttons button { font-size: 12px; padding: 12px 16px; }

.links { display: flex; gap: 18px; justify-content: center; }
.links a { color: var(--paper); }

#banner {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--felt-dark);
  border: 2px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  padding: 12px 16px;
  text-align: center;
  width: min(92vw, 420px);
}
#banner p { margin: 4px 0 0; font-size: 11px; line-height: 1.7; }
#banner .buttons { margin: 10px 0 0; }

@media (max-width: 420px) {
  #bar { gap: 6px; font-size: 8px; }
  #bar button { font-size: 8px; padding: 6px 6px; }
}
