* { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem 1rem;
  background: linear-gradient(135deg, #7a1320 0%, #1a1340 50%, #13317a 100%); background-attachment: fixed; color: #fff; }
.card { background: rgba(0,0,0,.35); backdrop-filter: blur(8px); padding: 2rem; border-radius: 20px;
  width: min(100%, 460px); text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,.4); }
h1 { margin: 0 0 .4rem; font-size: 2rem; }
h2 { margin: 0 0 .8rem; font-size: 1.25rem; }
p { line-height: 1.5; }
.muted { opacity: .7; font-size: .92rem; }
.dilemma { text-align: left; background: rgba(255,255,255,.07); border-radius: 14px; padding: 1rem 1.1rem; margin: 1.2rem 0; }
.dilemma p { margin: .4rem 0; }
.r { color: #ff8088; font-weight: 700; } .b { color: #88aaff; font-weight: 700; }
button, .btn { -webkit-tap-highlight-color: transparent; font: inherit; border: none; border-radius: 12px; padding: .9rem 1rem; font-weight: 700; cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
.primary { width: 100%; background: #fff; color: #111; font-size: 1.05rem; }
.secondary { background: rgba(255,255,255,.14); color: #fff; }
.danger { width: 100%; background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.35); }
.link { background: none; color: #fff; opacity: .75; padding: .2rem; text-decoration: underline; font-weight: 400; font-size: .9rem; }
.row { display: flex; gap: .6rem; }
.row > * { flex: 1; }
.stack > * + * { margin-top: .75rem; }
.divider { display: flex; align-items: center; gap: .8rem; opacity: .6; font-size: .85rem; margin: 1rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.3); }
input { width: 100%; padding: .85rem 1rem; border: none; border-radius: 12px; font-size: 1.05rem; outline: none; color: #111; }
input.code { text-transform: uppercase; letter-spacing: .3em; text-align: center; font-weight: 700; }
.roomcode { font-size: 3rem; font-weight: 800; letter-spacing: .25em; margin: .2rem 0 .4rem; padding-left: .25em; }
.you { display: flex; align-items: center; justify-content: center; gap: .5rem; margin: 1rem 0; flex-wrap: wrap; }
.players { list-style: none; padding: 0; margin: 1rem 0; text-align: left; }
.players li { display: flex; justify-content: space-between; padding: .5rem .3rem; border-bottom: 1px solid rgba(255,255,255,.12); }
.players li.me { font-weight: 700; }
.tag { font-size: .75rem; opacity: .75; font-weight: 400; margin-left: .4rem; }
.choices { display: flex; justify-content: center; gap: 1.2rem; margin: 1.4rem 0 1.6rem; }
/* Big domed buttons. The size is an explicit width and height, not
   aspect-ratio, which iOS Safari squashed in a flex row. It fits two across
   a phone: viewport minus body padding, card padding and the gap, halved. A
   locked-in vote stays pressed down and glows. */
.choice { --size: min(calc((100vw - 7.4rem) / 2), 170px); flex: none; width: var(--size); height: var(--size);
  padding: 0; border: none; border-radius: 50%; background: none; cursor: pointer; transition: opacity .2s, filter .2s; }
.choice .cap { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
  border-radius: 50%; color: #fff; font-size: 1.3rem; font-weight: 800; letter-spacing: .08em;
  text-shadow: 0 2px 3px rgba(0,0,0,.35); transform: translateY(-3px); transition: transform .08s, box-shadow .15s; }
.choice.red .cap { background: radial-gradient(circle at 50% 28%, #ff9aa0 0%, #f0414d 38%, #b3172a 100%);
  box-shadow: 0 7px 0 #6e0b16, 0 12px 20px rgba(0,0,0,.4), inset 0 -8px 14px rgba(0,0,0,.22); }
.choice.blue .cap { background: radial-gradient(circle at 50% 28%, #a6c0ff 0%, #3f78ff 38%, #1740b8 100%);
  box-shadow: 0 7px 0 #0b2470, 0 12px 20px rgba(0,0,0,.4), inset 0 -8px 14px rgba(0,0,0,.22); }
.choice:active .cap, .choice.sel .cap { transform: translateY(3px); }
.choice.red:active .cap { box-shadow: 0 1px 0 #6e0b16, 0 4px 8px rgba(0,0,0,.4), inset 0 -6px 12px rgba(0,0,0,.28); }
.choice.blue:active .cap { box-shadow: 0 1px 0 #0b2470, 0 4px 8px rgba(0,0,0,.4), inset 0 -6px 12px rgba(0,0,0,.28); }
.choice.red.sel .cap { box-shadow: 0 1px 0 #6e0b16, 0 0 36px 8px rgba(240,65,77,.7), inset 0 -6px 12px rgba(0,0,0,.28); }
.choice.blue.sel .cap { box-shadow: 0 1px 0 #0b2470, 0 0 36px 8px rgba(63,120,255,.7), inset 0 -6px 12px rgba(0,0,0,.28); }
.choice.dim { opacity: .4; filter: saturate(.5); }
.choice:focus-visible { outline: 3px solid #fff; outline-offset: 6px; }
.status { min-height: 3em; }
.progress { height: 8px; background: rgba(255,255,255,.15); border-radius: 99px; overflow: hidden; margin: .5rem 0 1rem; }
.progress span { display: block; height: 100%; background: #fff; transition: width .3s; }
.outcome { font-size: 1.35rem; font-weight: 800; margin: .3rem 0 1rem; }
.bar { display: flex; height: 46px; border-radius: 12px; overflow: hidden; margin-bottom: .6rem; background: #222; }
.bar span { display: flex; align-items: center; justify-content: center; font-weight: 700; padding: 0 .4rem; min-width: fit-content; }
.bred { background: #e23b46; } .bblue { background: #2f6bff; }
.nums { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 1rem; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; margin-bottom: 1.2rem; }
td { padding: .45rem .2rem; border-bottom: 1px solid rgba(255,255,255,.12); text-align: left; }
td.c { text-align: right; font-weight: 700; }
td.none { opacity: .55; font-weight: 400; font-style: italic; }
details { text-align: left; margin-top: 1rem; }
details summary { cursor: pointer; opacity: .8; margin-bottom: .6rem; }
details .result { margin-bottom: 1.2rem; }
.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); background: #111; color: #fff;
  padding: .7rem 1.1rem; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.4); max-width: 90vw; }
a { color: #fff; }
details .outcome { font-size: 1.05rem; }
/* Spinners: inline, and in place of a busy button's label. */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { display: inline-block; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -.15em; }
button.busy { position: relative; color: transparent !important; opacity: 1 !important; cursor: progress; }
button.busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 1.2em; height: 1.2em;
  border: 2.5px solid #fff; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
button.primary.busy::after { border-color: #111; border-right-color: transparent; }
.offline { background: rgba(255,200,80,.18); color: #ffe0a0; border-radius: 10px; padding: .45rem .8rem; font-size: .88rem; margin-bottom: 1rem; }
.logo { display: block; margin: 0 auto 1rem; width: 120px; height: 120px; filter: drop-shadow(0 8px 24px rgba(0,0,0,.45)); }
