/* Telefoon: mobile-first, grote knoppen, geen zoom van de pagina. */
body.phone {
  position: fixed; inset: 0;
  touch-action: manipulation;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  font-size: 17px;
  overscroll-behavior: none;
}
.phone input { -webkit-user-select: text; user-select: text; }
.phone .screen {
  position: absolute; inset: 0; z-index: 1;
  padding: calc(22px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
}
.phone .screen.center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; }
.phone .screen.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.phone a { color: var(--gold-2); }
.small { font-size: 14px; opacity: .85; }
.muted { opacity: .6; font-weight: 400; }
.dark { color: var(--ink); }

.logo { font-size: 44px; line-height: 1; text-align: center; }
.logo small { display: block; font-size: 22px; color: var(--cream); text-shadow: 0 2px 0 var(--red-1); margin-top: 6px; }
.logo.small { font-size: 36px; margin: 6px 0 14px; }

.card {
  background: var(--cream); color: var(--ink);
  border-radius: 20px; padding: 18px;
  border: 3px solid var(--gold);
  box-shadow: 0 5px 0 var(--gold-deep), 0 10px 24px rgba(0, 0, 0, .35);
  width: 100%; max-width: 440px; margin: 0 auto;
}

.code-input, .text-input {
  width: 100%; font-size: 22px; padding: 14px 16px;
  border-radius: 14px; border: 3px solid #e3cfa5; background: #fff; color: var(--ink);
  outline: none; font-weight: 700;
}
.code-input { font-family: var(--display); font-size: 40px; text-align: center; letter-spacing: 10px; text-transform: uppercase; margin-bottom: 14px; }
.text-input:focus, .code-input:focus { border-color: var(--gold); }

.lbl { display: block; font-weight: 800; margin: 16px 0 8px; font-size: 16px; }
.lbl:first-child { margin-top: 0; }
.photo-row { display: flex; align-items: center; gap: 14px; }
.photo-row .avatar { --size: 84px; }
.photo-btns { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.photo-btns .btn { font-size: 18px; min-height: 48px; }
.btn.ghost-dark { background: transparent; color: var(--ink); box-shadow: none; border: 2px solid #d9c49b; }

.emoji-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 18px; }
.emoji-grid button {
  font-size: 30px; aspect-ratio: 1; border-radius: 14px; border: 3px solid transparent;
  background: #f3e6cb; cursor: pointer; touch-action: manipulation; padding: 0;
}
.emoji-grid button.sel { border-color: var(--red-3); background: #fff; transform: scale(1.06); }
.error { color: var(--red-3); font-weight: 800; min-height: 1em; margin: 10px 0 0; text-align: center; }

.spinner { font-size: 64px; animation: float 1.6s ease-in-out infinite; }

/* ------------------------------------------------------------ lobby */
.me-card { text-align: center; margin: 8px 0 18px; }
.me-card .avatar { --size: 110px; animation: pop-in .5s ease-out both; }
.me-card h2 { font-size: 32px; margin-top: 10px; }
.me-card p { margin: 6px 0 0; opacity: .9; }
.host-title { font-family: var(--display); font-size: 22px; margin: 0 0 12px; text-align: center; }
#receiver-info { margin: 12px 0 0; text-align: center; }
.section-title { font-size: 22px; margin: 22px 0 10px; text-align: center; }
.player-list { list-style: none; margin: 0 auto; padding: 0; max-width: 440px; display: flex; flex-direction: column; gap: 8px; }
.player-list li { display: flex; align-items: center; gap: 12px; background: rgba(0, 0, 0, .2); border-radius: 14px; padding: 8px 12px; font-weight: 700; font-size: 18px; }
.player-list .avatar { --size: 44px; }
.player-list li.off { opacity: .5; }
.player-list .tag { margin-left: auto; font-size: 20px; }

/* ------------------------------------------------------------ spel */
.phone .screen.game { padding: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 8px;
  padding: calc(14px + env(safe-area-inset-top)) 10px 8px;
  background: linear-gradient(180deg, var(--red-1), rgba(92, 7, 16, .9));
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
  z-index: 3;
}
.chips-label { font-family: var(--display); font-size: 13px; line-height: 1.05; width: 52px; flex: none; color: var(--gold); }
.chips { display: flex; gap: 6px; overflow-x: auto; flex: 1; scrollbar-width: none; touch-action: pan-x; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: flex; align-items: center; gap: 6px; flex: none;
  background: var(--cream); color: var(--ink);
  border-radius: 999px; padding: 4px 10px 4px 4px;
  font-weight: 800; font-size: 15px; border: 2px solid transparent;
  touch-action: manipulation; cursor: pointer;
}
.chip .sw {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
  background: repeating-conic-gradient(#d8c8a8 0 25%, #efe3cb 0 50%) 50% / 10px 10px;
  border: 2px solid rgba(0, 0, 0, .15);
}
.chip.glitter { background: linear-gradient(90deg, #fff3c4, #ffd6f2, #fff3c4); background-size: 200% 100%; animation: shimmer 3s linear infinite; border-color: var(--gold); }
.chip.done { opacity: .55; }
.chip.done .left::after { content: ' ✓'; }
.chip.active { border-color: var(--red-3); }
.icon-btn { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--gold); background: var(--red-2); font-size: 22px; touch-action: manipulation; }

#board-wrap { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; background: #4a060d; }
#board { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
#board-wrap.shake { animation: shake .3s; }
#joker-hint {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%);
  background: var(--gold); color: var(--ink); font-weight: 800;
  padding: 8px 14px; border-radius: 12px; pointer-events: none; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .4);
}

.bottombar {
  display: flex; align-items: stretch; gap: 8px;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, var(--red-1), rgba(92, 7, 16, .9));
  box-shadow: 0 -2px 10px rgba(0, 0, 0, .35);
  z-index: 3;
}
.tool {
  flex: 1; min-height: 58px; border-radius: 14px; border: 0;
  background: var(--cream); color: var(--ink);
  font-size: 22px; line-height: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  box-shadow: 0 3px 0 #c9b48f; touch-action: manipulation;
  font-family: var(--display);
}
.tool span { font-size: 13px; }
.tool:active { transform: translateY(2px); box-shadow: 0 1px 0 #c9b48f; }
.tool.on { background: var(--gold); box-shadow: 0 3px 0 var(--gold-deep); }
.tool:disabled { opacity: .4; }
.tool.armed { background: var(--gold); animation: float 1s ease-in-out infinite; }
.left-count { flex: 1.2; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; }
.left-count b { font-family: var(--display); font-weight: 400; font-size: 28px; color: var(--gold); }
.left-count span { font-size: 12px; opacity: .9; text-align: center; }

#pause-overlay {
  position: absolute; inset: 0; z-index: 10;
  background: rgba(40, 3, 8, .82); backdrop-filter: blur(3px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--display); color: var(--gold);
}
#pause-overlay div { font-size: 80px; }
#pause-overlay p { font-size: 28px; margin: 0; }

#conn-banner {
  position: fixed; top: calc(14px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  background: #000d; color: #fff; padding: 8px 14px; border-radius: 12px; z-index: 120; font-weight: 700; font-size: 15px;
}

/* ------------------------------------------------------------ host-menu */
.sheet { position: fixed; inset: 0; z-index: 110; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.sheet-inner { display: flex; flex-direction: column; gap: 12px; animation: pop-in .25s ease-out; }

/* ------------------------------------------------------------ feest */
.party-sub { font-family: var(--display); font-size: 28px; margin: 0; }
#party-stats { font-size: 18px; font-weight: 700; }
#party-stats:empty { display: none; }
#host-party { width: 100%; max-width: 440px; }
