:root {
  --bg: #0a0a0a;
  --fg: #f5f5f0;
  --tile-bg: #161616;
  --tile-border: #262626;
  --accent: #ffb347;
  --muted: #6b6b66;
  --overlay: rgba(0, 0, 0, 0.72);
  --drawer-bg: #111;
}
body[data-theme="light"] {
  --bg: #faf7f0;
  --fg: #14110d;
  --tile-bg: #ffffff;
  --tile-border: #e6dfd0;
  --accent: #b8341c;
  --muted: #8a8275;
  --overlay: rgba(20, 17, 13, 0.55);
  --drawer-bg: #fff;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  padding: 0;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  transition: background 200ms ease, color 200ms ease;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
}
body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

/* ===== Top bar ===== */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px 12px;
  gap: 16px;
  flex: 0 0 auto;
}
.title {
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-actions { display: flex; gap: 10px; flex: 0 0 auto; }
.icon-btn {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 1px solid var(--tile-border);
  background: var(--tile-bg);
  color: var(--fg);
  font-size: 26px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 80ms ease, background 200ms ease;
}
.icon-btn:active { transform: scale(0.94); }

/* ===== Stacked section rows ===== */
main {
  flex: 1 1 auto;
  padding: 8px 28px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}
.tile {
  background: var(--tile-bg);
  border: 1px solid var(--tile-border);
  border-radius: 20px;
  padding: 12px 28px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 4px;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}
.tile-title {
  font-size: clamp(14px, 1.4vw, 20px);
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  flex: 0 0 auto;
  line-height: 1.1;
}
.tile-content {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 800;
  font-size: clamp(28px, 4.4vw, 60px);
  line-height: 1.1;
  letter-spacing: 0.01em;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--fg);
  min-width: 0;
}
.tile.empty .tile-content {
  color: var(--muted);
  font-weight: 600;
  font-size: clamp(22px, 2.8vw, 36px);
}

/* ===== Order button + footer ===== */
.bottom-bar {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 28px 14px;
  gap: 8px;
}
.order-btn {
  background: var(--accent);
  color: #14110d;
  border: none;
  border-radius: 14px;
  height: 56px;
  padding: 0 22px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 80ms ease, opacity 200ms ease;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.order-btn:active { transform: scale(0.96); }
.order-btn[hidden] { display: none; }
footer {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
footer a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--muted);
  padding-bottom: 1px;
}

/* ===== Drawer (menu) ===== */
.scrim {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 10;
}
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(440px, 80vw);
  background: var(--drawer-bg);
  border-left: 1px solid var(--tile-border);
  transform: translateX(100%);
  transition: transform 240ms cubic-bezier(.2,.8,.2,1);
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding: 22px 22px 28px;
  gap: 12px;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.drawer-head h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.song-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}
.song-list button {
  width: 100%;
  text-align: left;
  background: var(--tile-bg);
  color: var(--fg);
  border: 1px solid var(--tile-border);
  border-radius: 16px;
  padding: 20px 22px;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 80ms ease, border-color 160ms ease;
}
.song-list button:active { transform: scale(0.98); }
.song-list button.active {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== Order modal ===== */
.modal {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.modal.open { display: flex; }
.modal-card {
  background: var(--bg);
  border: 1px solid var(--tile-border);
  border-radius: 26px;
  padding: 28px 36px;
  max-width: 900px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-card h2 {
  margin: 0;
  color: var(--accent);
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.order-list {
  list-style: none;
  counter-reset: ord;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}
.order-list li {
  counter-increment: ord;
  font-size: clamp(18px, 1.9vw, 26px);
  font-weight: 700;
  padding: 4px 0;
  display: flex;
  gap: 14px;
  align-items: baseline;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.order-list li::before {
  content: counter(ord);
  color: var(--accent);
  font-weight: 800;
  min-width: 1.6em;
}
.modal-hint {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  margin-top: 4px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
