:root {
  --fondo: #f6f3ee;
  --carta: #fffdf9;
  --inchiostro: #1d1b18;
  --grigio: #8a847b;
  --linea: #ddd7cd;
  --accento: #2f5bea;
  --gettone: #cdc6bb;
  --bh: clamp(112px, 40vh, 280px);
  --bw: min(100%, calc(var(--bh) * 1.695));
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(10px, 3vh, 28px) 16px;
  overflow: hidden;
}

.poll {
  width: min(520px, 100%);
  background: var(--carta);
  border: 1px solid #ebe5db;
  border-radius: 18px;
  padding: clamp(12px, 3vh, 22px) clamp(14px, 4vw, 22px) clamp(10px, 2.4vh, 18px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 18px 40px -26px rgba(40, 30, 10, .35), 0 2px 6px -3px rgba(40, 30, 10, .12);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.poll__head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 650;
  letter-spacing: -.01em;
}

.brand__mark { width: 16px; height: 16px; fill: var(--inchiostro); }

.poll__tag {
  color: var(--grigio);
  font-weight: 500;
  border: 1px solid var(--linea);
  padding: 3px 8px;
  border-radius: 99px;
}

.poll__q {
  width: 100%;
  margin: clamp(8px, 2vh, 16px) 0 4px;
  font-size: clamp(17px, 2.3vh + 6px, 24px);
  line-height: 1.12;
  font-weight: 640;
  font-variation-settings: "wdth" 96;
  letter-spacing: -.02em;
}

.poll__meta {
  width: 100%;
  margin: 0 0 clamp(4px, 1.4vh, 10px);
  font-size: 12px;
  color: var(--grigio);
  display: flex;
  align-items: center;
  gap: 4px;
}

.poll__sep { width: 1px; height: 10px; background: var(--linea); margin: 0 6px; }

[data-state] { display: inline-block; }
.is-voted [data-state] { color: var(--accento); }

.board {
  position: relative;
  width: var(--bw);
  aspect-ratio: 400 / 236;
}

.board__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.col__glass { fill: url(#glass); opacity: .5; }
.col__line { fill: none; stroke: var(--linea); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.col__floor { stroke: #cbc4b8; stroke-width: 2; stroke-linecap: round; }
.col__tick { stroke: #eee8de; stroke-width: 1; }
.rim { fill: none; stroke: var(--accento); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }

.tok__body { fill: var(--gettone); }
.tok__edge { fill: none; stroke: rgba(60, 45, 20, .12); stroke-width: 1; }
.tok__shine { fill: url(#shine); }
.tok--mine .tok__body { fill: var(--accento); }
.tok--mine .tok__edge { stroke: rgba(10, 20, 80, .25); }

.pcts { position: absolute; inset: 0; pointer-events: none; }

.pct {
  position: absolute;
  top: 0;
  transform: translate(-50%, 0);
  font-size: clamp(11px, 1.3vh + 4px, 15px);
  font-weight: 620;
  font-variation-settings: "wdth" 100;
  display: flex;
  align-items: baseline;
  white-space: nowrap;
}

.pct__sign { font-size: .78em; color: var(--grigio); margin-left: 1px; }
.pct.is-mine { color: var(--accento); }
.pct.is-mine .pct__sign { color: var(--accento); }

.roll { display: inline-flex; align-items: baseline; line-height: 1.18; }
.roll__d { display: inline-block; height: 1.18em; overflow: hidden; }
.roll__s { display: flex; flex-direction: column; }
.roll__s span { height: 1.18em; line-height: 1.18; text-align: center; }
.roll__c { display: inline-block; line-height: 1.18; }

.answers {
  width: var(--bw);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 6px;
}

.ans {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  color: var(--inchiostro);
  padding: 6px 2px 4px;
  margin: 0 4%;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: clamp(10.5px, .9vh + 5px, 13px);
  line-height: 1.15;
  font-weight: 520;
  font-variation-settings: "wdth" 100;
  text-align: center;
  transition: background-color .2s;
  -webkit-tap-highlight-color: transparent;
}

.ans__check { width: 12px; height: 12px; fill: none; stroke: var(--accento); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ans__label { display: inline-block; }
.ans:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
.ans.is-on { color: var(--accento); font-weight: 680; }

@media (hover: hover) {
  .ans:hover { background: #f3eee6; }
}

.cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  fill: var(--inchiostro);
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  pointer-events: none;
  opacity: 0;
  z-index: 20;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .18));
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
