/* HIBAG Food Destiny – web host page (v1.3.0). Builds on style.css. */
[hidden] { display: none !important; }
.host-main { max-width: 1040px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center-block { display: block; margin: 10px auto 0; }
.msg { color: var(--danger); font-weight: 700; text-align: center; margin: 8px 0 0; }
.msg.ok { color: var(--accent); }
.fine { color: var(--muted); font-size: 12px; text-align: center; margin: 14px 0 0; }

/* Auth */
.auth { max-width: 420px; margin: 0 auto; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: rgba(255,255,255,.05); padding: 4px; border-radius: 14px; margin-bottom: 18px; }
.tabs button { border: 0; border-radius: 10px; padding: 10px; font: inherit; font-weight: 800; color: var(--muted); background: transparent; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--accent); color: #0C0C12; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 16px 0; font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.google-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: #1f1f1f; font: inherit; font-weight: 800; cursor: pointer; }
.cta.secondary { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.cta.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }

/* Dashboard */
.toolbar { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-bottom: 12px; flex-wrap: wrap; }
.badge { background: var(--accent); color: #0C0C12; font-weight: 900; font-size: 11px; padding: 3px 8px; border-radius: 999px; letter-spacing: 1px; }
.dash-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 860px) {
  .dash-grid.voting { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}
.stage-card { padding: 18px; }
.die-box { height: 340px; display: grid; place-items: center; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.actions .cta { flex: 1 1 180px; margin: 0; }
.vote-panel { display: grid; gap: 16px; }
.qr-card { text-align: center; }
.qr { background: #fff; border-radius: 18px; padding: 12px; width: min(240px, 70vw); margin: 8px auto; }
.qr svg, .qr img { width: 100%; height: auto; display: block; }
.big-code { font-size: 40px; font-weight: 900; letter-spacing: 10px; margin: 6px 0; }
.link-row { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
.link-row a { color: var(--accent); font-weight: 700; word-break: break-all; }
.live { color: #ff4d6d; font-size: 11px; letter-spacing: 2px; margin-left: 6px; }
.voters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.voter { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px 4px 4px; font-size: 13px; font-weight: 700; }
.odds { display: grid; gap: 6px; }
.odd { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; background: rgba(255,255,255,.04); border-radius: 14px; padding: 8px 10px; }
.odd .e { font-size: 22px; text-align: center; }
.odd .n { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.odd .sub2 { color: var(--muted); font-size: 11px; font-weight: 600; }
.odd .bar { height: 6px; border-radius: 4px; background: rgba(255,255,255,.08); margin-top: 5px; overflow: hidden; }
.odd .bar i { display: block; height: 100%; border-radius: 4px; background: var(--c, var(--accent)); transition: width .4s; }
.odd .p { font-weight: 900; text-align: right; }
.odd .p small { display: block; color: var(--muted); font-weight: 600; font-size: 11px; }
.odd.win { outline: 2px solid var(--accent); }
.more-odds { color: var(--muted); font-size: 12px; text-align: center; padding: 4px; }

/* 3D die */
.die3d-stage { position: relative; width: calc(var(--size) * 1.6); height: calc(var(--size) * 1.5); perspective: 1100px; display: grid; place-items: center; }
.die3d { position: relative; width: 0; height: 0; transform-style: preserve-3d; will-change: transform; }
.die3d-face { position: absolute; left: 0; top: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.die3d-face::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.22), rgba(0,0,0,.22)); }
.die3d-content { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2px; }
.die3d-emoji { line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.die3d-name { font-weight: 900; line-height: 1.05; text-transform: uppercase; letter-spacing: .02em; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.die3d-shade { position: absolute; inset: 0; background: #000; pointer-events: none; }
.die3d-shadow { position: absolute; bottom: 4%; width: calc(var(--size) * .9); height: calc(var(--size) * .16); border-radius: 50%; background: radial-gradient(rgba(0,0,0,.75), rgba(0,0,0,0) 70%); }

/* Result */
.result { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(12,12,18,.78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); overflow-y: auto; }
.result[hidden] { display: none; }
.result-card { width: min(480px, 100%); text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: 26px 20px; animation: pop .5s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.r-tile { width: 132px; height: 132px; border-radius: 34px; margin: 10px auto 14px; display: grid; place-items: center; font-size: 70px; box-shadow: 0 10px 40px var(--glow, rgba(200,255,61,.35)); }
.r-voters { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0; }
.place-box { display: flex; gap: 12px; align-items: center; text-align: left; background: rgba(255,255,255,.05); border-radius: 18px; padding: 12px; margin: 14px 0 6px; }
.place-lines { flex: 1; display: grid; gap: 2px; font-size: 14px; }
.place-lines .dist { color: var(--accent); font-weight: 800; }
.place-lines .note { color: #ffc857; font-size: 12px; }
.place-btns { display: grid; gap: 6px; justify-items: center; }
.small-cta { padding: 10px 14px !important; font-size: 14px !important; text-decoration: none; white-space: nowrap; }

/* v1.5.0 – department, banner, join requests */
.dept-row { display: grid; gap: 6px; margin-bottom: 12px; }
.dept-row label { font-weight: 800; }
.dept-inline { display: flex; gap: 8px; }
.dept-inline input { flex: 1; min-width: 0; text-transform: uppercase; }
.small-btn { width: auto; padding: 10px 16px; margin: 0; }
.dept-banner { border: 2px solid var(--accent); margin-bottom: 12px; }
.dept-banner p:first-child { font-weight: 800; font-size: 17px; margin: 0 0 10px; }
.requests { display: grid; gap: 8px; }
.request { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.request b { flex: 1 1 100%; }
.request button { width: auto; margin: 0; padding: 8px 14px; }

/* Responsive (v1.6.0): QR big enough to project from a laptop; tight phones. */
@media (min-width: 860px) {
  .qr { width: min(400px, 34vw); }
  .big-code { font-size: clamp(32px, 3.4vw, 56px); }
}
@media (min-width: 1400px) {
  .host-main { max-width: 1320px; }
  .qr { width: min(520px, 32vw); }
}
@media (max-width: 400px) {
  .actions .cta { flex-basis: 100%; }
}
.toolbar a, .toolbar .linkbtn { min-height: 44px; display: inline-flex; align-items: center; }
.link-row { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.link-row a { min-height: 44px; display: inline-flex; align-items: center; overflow-wrap: anywhere; }
.die3d-face.dim { filter: grayscale(.9) brightness(.5); }

/* v1.6.5 roll modes */
.roll-with { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.roll-with button { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  color: var(--text); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.roll-with button[aria-pressed="true"] { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.odd.filler { opacity: .45; filter: grayscale(.8); }
.coin3d { position: relative; width: min(200px, 60vw); aspect-ratio: 1; margin: 10px auto; transform-style: preserve-3d; }
.coin-face { position: absolute; inset: 0; border-radius: 50%; display: grid; place-content: center; justify-items: center; gap: 4px;
  text-align: center; padding: 18px; backface-visibility: hidden; box-shadow: inset 0 0 0 6px rgba(255,255,255,.35), 0 10px 30px rgba(0,0,0,.45); }
.coin-face.back { transform: rotateY(180deg); }
.coin-face .ce { font-size: 48px; line-height: 1; }
.coin-face b { font-size: 16px; font-weight: 900; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.coin-face small { font-weight: 800; opacity: .9; }
.r-unanimous { margin: 4px 0 8px; font-weight: 800; }
.r-unanimous[hidden] { display: none; }
.r-unanimous p { margin: 0 0 4px; font-size: 17px; color: var(--accent); }
.confetti { position: fixed; top: -30px; font-size: 26px; pointer-events: none; z-index: 60; animation: confetti-fall 2.2s ease-in forwards; }
@keyframes confetti-fall { to { transform: translateY(105vh) rotate(540deg); opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }
.gsi-btn { all: unset; box-sizing: border-box; display: flex; justify-content: center; align-items: center; width: 100%; min-height: 44px; cursor: pointer; border-radius: 22px; }
.gsi-btn img { display: block; width: 180px; height: 40px; }
.gsi-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#dept-row[hidden], #roll-with[hidden] { display: none !important; }
