/* 관객 폰 화면: 밝은 스튜디오 테마, 누르는 느낌이 나는 입체 버튼 */
body.vote-body {
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 90% 40% at 50% 0%, #ffffff, rgba(255, 255, 255, 0) 70%),
    radial-gradient(ellipse 80% 40% at 0% 100%, rgba(255, 79, 94, 0.12), transparent 70%),
    radial-gradient(ellipse 80% 40% at 100% 100%, rgba(47, 107, 255, 0.14), transparent 70%),
    linear-gradient(180deg, #f6f8fc, #e8ecf5);
  background-attachment: fixed;
  padding-bottom: calc(132px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}

.top {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  padding-top: calc(14px + env(safe-area-inset-top));
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink-3);
}

.dot.on {
  background: #1fbf7a;
  box-shadow: 0 0 0 4px rgba(31, 191, 122, 0.18);
}

.dot.off {
  background: var(--a);
}

main {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px 0;
}

/* 대기 */
.idle {
  padding: 26px 4px;
}

.idle .now-label {
  margin: 0;
  font-size: 14px;
  font-weight: 750;
  color: var(--ink-3);
}

.idle h1 {
  margin: 6px 0 16px;
  font-size: 32px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.idle-msg {
  margin: 0;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-2);
}

.idle .event {
  margin-top: 28px;
  padding: 18px 20px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 16px 30px -22px rgba(16, 20, 43, 0.35);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
}

.idle .event b {
  display: block;
  margin-bottom: 4px;
  font-size: 17px;
  color: var(--ink);
}

.idle .count {
  margin-top: 22px;
  font-size: 17px;
  font-weight: 750;
}

.idle .count b {
  margin-right: 4px;
  font-size: 30px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

/* 게임 */
.g-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 750;
  color: var(--ink-3);
}

.g-head b {
  margin-right: 4px;
  font-size: 24px;
  font-weight: 900;
  color: var(--ink);
}

.pick {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  min-height: clamp(118px, 18vh, 190px);
  padding: 20px 22px;
  border: 0;
  border-radius: 26px;
  text-align: left;
  cursor: pointer;
  color: #fff;
  transform: translateY(0);
  transition: transform 0.12s, box-shadow 0.12s, filter 0.3s, opacity 0.3s;
  touch-action: manipulation;
}

.pick-a {
  background: linear-gradient(140deg, #ff7a85, var(--a) 45%, var(--a-deep));
  box-shadow: 0 7px 0 #b51d30, 0 22px 30px -14px rgba(217, 42, 61, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.35);
}

.pick-b {
  align-items: flex-end;
  text-align: right;
  background: linear-gradient(220deg, #6b95ff, var(--b) 45%, var(--b-deep));
  box-shadow: 0 7px 0 #1437a6, 0 22px 30px -14px rgba(26, 70, 209, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.35);
}

.pick:active {
  transform: translateY(6px);
}

.pick-a:active {
  box-shadow: 0 1px 0 #b51d30, 0 10px 18px -12px rgba(217, 42, 61, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.35);
}

.pick-b:active {
  box-shadow: 0 1px 0 #1437a6, 0 10px 18px -12px rgba(26, 70, 209, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.35);
}

.pick-tag {
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  opacity: 0.85;
}

.pick-opt {
  margin-top: 8px;
  font-size: 27px;
  font-weight: 850;
  line-height: 1.25;
  letter-spacing: -0.035em;
}

.pick-me {
  position: absolute;
  top: 14px;
  right: 16px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s, transform 0.3s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.pick-b .pick-me {
  right: auto;
  left: 16px;
}

.pick.mine .pick-me {
  opacity: 1;
  transform: none;
}

.pick.mine {
  outline: 4px solid var(--ink);
  outline-offset: 4px;
}

.game.voted .pick:not(.mine) {
  filter: saturate(0.25) brightness(1.08);
  opacity: 0.55;
}

.pick:disabled {
  cursor: default;
}

.game.closed .pick:not(.mine) {
  opacity: 0.35;
}

.pick.pop {
  animation: pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes pop {
  40% {
    transform: translateY(-4px) scale(1.03);
  }
}

.g-vs {
  position: relative;
  z-index: 1;
  width: 54px;
  height: 54px;
  margin: -10px auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 0 0 5px #f2f4fa;
}

.g-status {
  margin: 18px 2px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-2);
  text-align: center;
}

.g-cancel {
  display: block;
  min-height: 40px;
  margin: 4px auto 0;
  padding: 0 16px;
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.g-cancel[hidden] {
  display: none;
}

.g-result {
  margin-top: 16px;
}

.mbar {
  display: flex;
  height: 40px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-2);
}

.mbar i {
  display: flex;
  align-items: center;
  font-style: normal;
  font-size: 17px;
  font-weight: 900;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  transition: flex-basis 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mbar .a {
  padding-left: 12px;
  background: linear-gradient(180deg, #ff7480, var(--a-deep));
}

.mbar .b {
  justify-content: flex-end;
  padding-right: 12px;
  background: linear-gradient(180deg, #6690ff, var(--b-deep));
}

.g-blind {
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
}

.g-panel {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 16px 30px -24px rgba(16, 20, 43, 0.4);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.75;
}

.g-panel .same {
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.side-A-text {
  color: var(--a-deep);
}

.side-B-text {
  color: var(--b-deep);
}

.g-comment {
  margin-top: 18px;
  padding: 16px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 16px 30px -24px rgba(16, 20, 43, 0.4);
}

.g-comment label {
  display: block;
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 850;
}

.g-comment .row {
  display: flex;
  gap: 8px;
}

.g-comment input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.g-comment input:focus {
  outline: none;
  border-color: var(--ink);
  background: #fff;
}

.g-comment button {
  flex: none;
  height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.g-comment button:disabled {
  opacity: 0.35;
}

.g-comment small {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-3);
}

.g-comment small.ok {
  color: var(--b-deep);
  font-weight: 750;
}

/* 나의 결과 */
.mine h1 {
  margin: 6px 0 16px;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.type-card {
  padding: 22px 20px;
  border-radius: 24px;
  background: radial-gradient(circle at 20% 0%, #2a3160, var(--ink) 70%);
  color: #fff;
  box-shadow: 0 24px 40px -24px rgba(16, 20, 43, 0.7);
}

.type-card small {
  font-size: 13px;
  font-weight: 750;
  opacity: 0.7;
}

.type-card b {
  display: block;
  margin: 4px 0;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.035em;
}

.type-card span {
  font-size: 15px;
  font-weight: 650;
  opacity: 0.85;
}

.mine-rows {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.mine-rows li {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  font-weight: 750;
}

.mine-rows .r {
  font-weight: 850;
  color: var(--ink-3);
}

.mine-rows .tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: 12px;
  white-space: nowrap;
}

.mine-rows .tag.maj {
  background: var(--ink);
  color: #fff;
}

.sync {
  margin-top: 16px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-2);
}

.sync b {
  color: var(--ink);
}

/* 이모지 반응 */
.react {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}

.react p {
  margin: 0 0 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 750;
  color: var(--ink-3);
}

.react-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  max-width: 520px;
  margin: 0 auto;
}

.react-row button {
  flex: 1;
  max-width: 76px;
  height: 62px;
  border: 0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 4px 0 #d9deea, 0 10px 18px -12px rgba(16, 20, 43, 0.4);
  font-size: 30px;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.1s, box-shadow 0.1s;
}

.react-row button:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 #d9deea, 0 4px 10px -8px rgba(16, 20, 43, 0.4);
}

#fly {
  position: fixed;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  pointer-events: none;
}

.fly {
  position: absolute;
  font-size: 34px;
  animation: fly 1.1s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

@keyframes fly {
  to {
    transform: translate(var(--dx), -260px) scale(1.4);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pick.pop {
    animation: none;
  }

  .fly {
    display: none;
  }
}
