:root {
  color-scheme: dark;
  --bg: #050706;
  --bg-soft: #0b0f0d;
  --panel: #101513;
  --panel-2: #141b18;
  --line: #26332d;
  --line-strong: #34443c;
  --text: #f4fbf6;
  --muted: #9caaa2;
  --green: #1ed760;
  --green-soft: #113b24;
  --amber: #ffc857;
  --red: #ff5f66;
  --blue: #70a7ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(30, 215, 96, 0.09), transparent 36rem),
    radial-gradient(circle at 78% 0%, rgba(255, 200, 87, 0.08), transparent 22rem),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  color: var(--text);
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: #080b0a;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(30, 215, 96, 0.14);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.22rem, 2vw, 1.7rem);
  line-height: 1.05;
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.7rem);
  line-height: 1;
}

h3 {
  font-size: 1.15rem;
  line-height: 1.12;
}

.app-shell {
  width: min(1440px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 0 42px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(120px, 0.5fr);
  gap: 18px;
  align-items: center;
  padding: 14px 0 18px;
  background: linear-gradient(180deg, rgba(5, 7, 6, 0.96) 72%, rgba(5, 7, 6, 0));
  backdrop-filter: blur(14px);
}

.page-label {
  min-width: 0;
}

body[data-mode="titles"] .page-label {
  visibility: hidden;
}

body[data-mode="titles"][data-identity-ready="false"] .topbar,
body[data-mode="titles"][data-identity-ready="false"] .intro-band {
  display: none;
}

body[data-mode="titles"][data-identity-ready="false"] .app-shell {
  display: grid;
  width: min(1440px, calc(100% - 32px));
  min-height: 100vh;
  padding: 0;
}

body[data-mode="titles"][data-identity-ready="false"] main,
body[data-mode="titles"][data-identity-ready="false"] #panel-titles {
  display: grid;
  min-height: 100vh;
}

.brand-block {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(30, 215, 96, 0.36);
  border-radius: 8px;
  color: #061008;
  background: var(--green);
  font-weight: 900;
}

.hidden {
  display: none !important;
}

.eyebrow {
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.route-links {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.route-link {
  display: inline-grid;
  min-height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  background: #0d1310;
  text-decoration: none;
  font-weight: 800;
}

.route-link:hover {
  border-color: var(--green);
  color: var(--text);
}

.view-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 17, 15, 0.86);
}

.tab-button {
  min-height: 38px;
  border-radius: 6px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.tab-button:hover {
  color: var(--text);
  background: #17201b;
}

.tab-button.active {
  color: #071008;
  background: var(--green);
  font-weight: 800;
}

.save-pill {
  justify-self: end;
  min-width: 112px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  text-align: center;
  background: rgba(10, 13, 12, 0.8);
}

.top-profile-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-self: end;
  min-width: 0;
}

.ghost-button.top-profile-edit {
  min-height: 32px;
  border-color: rgba(30, 215, 96, 0.28);
  padding: 0 10px;
  color: var(--muted);
  background: rgba(12, 17, 15, 0.72);
  font-size: 0.78rem;
  font-weight: 850;
}

.ghost-button.top-profile-edit:hover {
  color: var(--text);
}

.save-pill.player-pill {
  border-color: rgba(30, 215, 96, 0.38);
  color: var(--green);
  background: rgba(30, 215, 96, 0.08);
  font-weight: 900;
}

.view,
.panel {
  display: none;
  animation: viewIn 240ms ease both;
}

.view.active,
.panel.active {
  display: block;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.intro-band,
.game-topline {
  display: flex;
  gap: 20px;
  align-items: end;
  justify-content: space-between;
  min-height: 164px;
  border-block: 1px solid var(--line);
  padding: 32px 0;
}

.intro-band.compact,
.game-topline {
  min-height: 112px;
}

.channel-card,
.fill-toolbar,
.twitch-panel {
  display: flex;
  gap: 10px;
  align-items: end;
}

.all-done-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0;
  padding: 18px 22px;
  border: 1px solid rgba(30, 215, 96, 0.46);
  border-radius: 8px;
  background: var(--green-soft);
  box-shadow: 0 0 24px rgba(30, 215, 96, 0.18);
}

.all-done-banner strong {
  display: block;
  margin-top: 2px;
  font-size: 1.15rem;
  color: var(--text);
}

.channel-card {
  min-width: min(360px, 100%);
}

.workspace {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.admin-layout {
  grid-template-columns: 330px minmax(0, 1fr) 240px;
  align-items: start;
}

.two-columns {
  grid-template-columns: 360px minmax(0, 1fr);
}

.share-list {
  display: grid;
  gap: 12px;
}

.share-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #0b100d;
}

.share-row strong,
.share-row span {
  display: block;
}

.share-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.share-row input {
  min-height: 38px;
  font-size: 0.78rem;
}

.share-row.host-link {
  border-color: rgba(30, 215, 96, 0.34);
}

.admin-users-block {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.section-head.compact {
  margin-bottom: 0;
}

.admin-user-list {
  display: grid;
  gap: 10px;
}

.admin-user-row {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #0b100d;
}

.admin-user-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.admin-user-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(30, 215, 96, 0.34);
  border-radius: 50%;
  color: var(--green);
  background: #071008;
  font-size: 0.9rem;
  font-weight: 950;
}

.admin-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-user-head strong,
.admin-user-head span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-head span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.admin-user-row input {
  min-height: 38px;
}

.admin-user-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-user-actions .ghost-button,
.admin-user-actions .danger-button {
  min-height: 36px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.tool-panel,
.editor-stage,
.scoreboard,
.game-board,
.game-footer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 21, 19, 0.88);
  box-shadow: var(--shadow);
}

.tool-panel {
  padding: 18px;
}

.section-head {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.button-row.stacked {
  align-items: stretch;
  flex-direction: column;
}

.primary-button,
.ghost-button,
.danger-button,
.icon-button {
  display: inline-grid;
  min-height: 42px;
  place-items: center;
  border-radius: 8px;
  padding: 0 15px;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.primary-button {
  color: #061008;
  background: var(--green);
  box-shadow: 0 0 18px rgba(30, 215, 96, 0.22);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 26px rgba(30, 215, 96, 0.34);
}

.ghost-button {
  border: 1px solid var(--line);
  color: var(--text);
  background: #111714;
}

.ghost-button:hover {
  border-color: var(--green);
  background: #17231c;
}

.danger-button,
.icon-button.danger {
  color: white;
  background: #45151a;
}

.danger-button:hover,
.icon-button.danger:hover {
  background: #672028;
}

.icon-button {
  width: 42px;
  padding: 0;
  border: 1px solid var(--line);
  color: var(--text);
  background: #111714;
  font-size: 1.2rem;
}

.icon-button:hover {
  border-color: var(--green);
  background: #17231c;
}

.player-editor {
  display: grid;
  gap: 12px;
}

.player-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
}

.player-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: #061008;
  background: var(--green);
  font-weight: 900;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
}

.photo-slot {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #080b0a;
  transition: transform 160ms ease, border-color 160ms ease;
}

.photo-slot:hover {
  border-color: var(--green);
  transform: translateY(-2px);
}

.photo-thumb {
  position: relative;
  min-height: 158px;
  overflow: hidden;
  border-radius: 8px;
}

.photo-slot img,
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-slot button {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: end start;
  padding: 10px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.74));
  text-align: left;
}

.photo-crop-button {
  inset: auto 8px 8px auto !important;
  z-index: 2;
  min-height: 32px;
  border: 1px solid rgba(30, 215, 96, 0.42);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--green);
  background: rgba(5, 8, 7, 0.84);
  font-size: 0.72rem;
  font-weight: 850;
  backdrop-filter: blur(10px);
}

.photo-name-field {
  gap: 6px;
  font-size: 0.76rem;
}

.photo-name-field input {
  min-height: 36px;
  font-size: 0.86rem;
}

.photo-slot strong {
  display: block;
  font-size: 0.9rem;
}

.photo-slot span {
  color: var(--muted);
  font-size: 0.74rem;
}

.photo-empty {
  display: grid;
  min-height: 158px;
  place-items: center;
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(30, 215, 96, 0.1), transparent),
    #080b0a;
}

.crop-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 5, 4, 0.76);
  backdrop-filter: blur(16px);
}

.crop-card {
  display: grid;
  gap: 14px;
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #0b100d;
  box-shadow: var(--shadow);
}

.crop-preview {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(30, 215, 96, 0.26);
  border-radius: 8px;
  background: #050706;
}

.crop-preview::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(30, 215, 96, 0.18);
}

.crop-preview canvas {
  width: min(100%, 430px);
  aspect-ratio: 1 / 1;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.crop-preview canvas.dragging {
  cursor: grabbing;
}

.crop-controls {
  display: grid;
  gap: 10px;
}

.crop-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.fill-layout {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.identity-panel {
  display: grid;
  min-height: 360px;
  place-items: center;
}

body[data-mode="titles"][data-identity-ready="false"] .identity-panel {
  min-height: 100vh;
}

.identity-card {
  display: grid;
  width: 100%;
  max-width: 460px;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(22px, 4vw, 34px);
  background: rgba(16, 21, 19, 0.92);
  box-shadow: var(--shadow);
}

.identity-card h2 {
  margin-top: 5px;
  font-size: clamp(1.8rem, 5vw, 3rem);
}

.identity-avatar-picker {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  background: #0c110f;
  text-align: left;
}

.identity-avatar-picker:hover,
.identity-avatar-picker:focus-visible {
  border-color: var(--green);
  background: #111914;
}

.identity-avatar-preview {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(30, 215, 96, 0.42);
  border-radius: 50%;
  color: var(--green);
  background: #071008;
}

.identity-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.identity-avatar-preview span {
  font-size: 1.55rem;
  font-weight: 950;
}

.identity-avatar-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.identity-avatar-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-name-field {
  color: var(--text);
}

.identity-name-field input {
  min-height: 52px;
  font-size: 1.05rem;
}

.identity-card .start-button {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  font-size: 1.05rem;
  font-weight: 900;
}

.identity-message {
  min-height: 20px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.identity-message.error {
  color: var(--red);
}

.round-strip {
  display: grid;
  max-height: calc(100vh - 188px);
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
}

.round-dot {
  position: relative;
  display: grid;
  width: 72px;
  min-height: 46px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #0c110f;
  font-weight: 850;
}

.round-dot.done {
  color: var(--muted);
  background: #0c110f;
}

.round-dot.done::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(30, 215, 96, 0.35);
}

.round-dot.done.active::after {
  display: none;
}

.round-dot.active {
  border-color: var(--line);
  color: var(--green);
  background: #0c110f;
}

.round-dot:focus,
.round-dot:focus-visible {
  outline: none;
  box-shadow: none;
}

.editor-stage {
  display: grid;
  grid-template-columns: minmax(280px, 42%) minmax(0, 1fr);
  gap: 22px;
  padding: 18px;
}

.player-profile-wrap {
  grid-column: 1 / -1;
}

.player-profile-card {
  display: flex;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(12, 17, 15, 0.86);
}

.inline-error {
  display: none;
  margin-top: 6px;
  color: #ff4444;
  font-size: 0.82rem;
  font-weight: 600;
  animation: inlineErrorIn 0.15s ease;
}

@keyframes inlineErrorIn {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.profile-avatar-button {
  position: relative;
  display: grid;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  padding: 0;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(30, 215, 96, 0.42);
  border-radius: 50%;
  color: var(--green);
  background: #071008;
  box-shadow: 0 0 18px rgba(30, 215, 96, 0.16);
}

.profile-avatar-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-button span {
  font-size: 1.3rem;
  font-weight: 950;
}

.player-profile-card strong {
  display: block;
  max-width: min(42ch, 70vw);
  overflow: hidden;
  color: var(--text);
  font-size: 1.2rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.round-preview {
  display: grid;
  align-content: start;
  gap: 14px;
}

.fill-photo-name {
  min-height: 36px;
  color: var(--green);
  font-size: clamp(1.25rem, 2.4vw, 2.2rem);
  font-weight: 950;
  line-height: 1.05;
  text-align: center;
}

.photo-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #070908;
}

.photo-frame.large {
  aspect-ratio: 1 / 1;
}

.empty-photo {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #080b0a;
}

.empty-photo.hidden {
  display: none;
}

.saved-photo-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  gap: 8px;
  align-content: center;
  color: #eafff1;
  background:
    linear-gradient(rgba(0, 0, 0, 0.26), rgba(0, 0, 0, 0.26)),
    rgba(30, 215, 96, 0.3);
  text-align: center;
  pointer-events: none;
}

.saved-photo-overlay span {
  display: grid;
  width: clamp(58px, 9vw, 92px);
  height: clamp(58px, 9vw, 92px);
  place-items: center;
  border: 2px solid rgba(234, 255, 241, 0.9);
  border-radius: 50%;
  color: #071008;
  background: var(--green);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 0 32px rgba(30, 215, 96, 0.42);
}

.saved-photo-overlay strong {
  color: #eafff1;
  font-size: clamp(1.1rem, 2.2vw, 1.55rem);
  font-weight: 950;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.48);
}

.round-controls {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 10px;
  align-items: center;
}

.round-controls>div {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: #0c110f;
}

.music-editor {
  display: grid;
  align-content: start;
  gap: 16px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.audio-lab {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #0a0e0c;
}

.audio-lab.empty {
  opacity: 0.55;
}

#waveCanvas {
  width: 100%;
  height: 118px;
  border-radius: 8px;
  background: #050806;
  cursor: crosshair;
  touch-action: none;
}

.wave-preview-row {
  display: flex;
  justify-content: center;
  margin-top: -4px;
}

.preview-play-button {
  border-color: rgba(30, 215, 96, 0.45);
  color: #061008;
  background: var(--green);
  box-shadow: 0 0 18px rgba(30, 215, 96, 0.22);
}

.preview-play-button:disabled {
  opacity: 0.45;
  box-shadow: none;
  transform: none;
}

body[data-mode="titles"] #saveClipButton:not(:disabled) {
  animation: saveButtonPulse 1.8s ease-in-out infinite;
  transform-origin: center;
}

body[data-mode="titles"] #saveClipButton:not(:disabled):hover {
  animation-play-state: paused;
  transform: scale(1.025);
}

@keyframes saveButtonPulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 18px rgba(30, 215, 96, 0.22);
  }

  50% {
    transform: scale(1.035);
    box-shadow: 0 0 28px rgba(30, 215, 96, 0.34);
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-mode="titles"] #saveClipButton:not(:disabled) {
    animation: none;
  }
}

.clip-readout {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--muted);
  background: #070b09;
  font-size: 0.86rem;
}

.clip-readout strong {
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

.range-row {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.volume-row {
  grid-template-columns: 48px 1fr 58px;
}

input[type="range"] {
  accent-color: var(--green);
  padding: 0;
}

.saved-clip {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #0c110f;
}

.saved-clip strong {
  display: block;
  max-width: 56ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-chip {
  display: grid;
  min-height: 42px;
  min-width: 76px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green);
  background: #0b100d;
  font-weight: 900;
}

.game-topline {
  align-items: center;
}

.start-panel {
  display: grid;
  gap: 14px;
  min-height: min(76vh, 720px);
  align-content: center;
  justify-items: center;
}

.start-round-select {
  width: min(420px, 86vw);
  min-height: 42px;
  border: 1px solid rgba(30, 215, 96, 0.34);
  border-radius: 8px;
  padding: 0 14px;
  color: #ffffff;
  background: #0b100d;
  box-shadow: 0 0 18px rgba(30, 215, 96, 0.12);
  font-size: clamp(0.92rem, 1.8vw, 1.1rem);
  font-weight: 850;
  text-align: center;
}

.start-button {
  min-width: min(420px, 86vw);
  min-height: 96px;
  border-radius: 8px;
  font-size: clamp(2rem, 7vw, 5rem);
  font-weight: 950;
  box-shadow: 0 0 24px rgba(30, 215, 96, 0.3), 0 0 70px rgba(30, 215, 96, 0.12);
}

.lobby-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1fr) minmax(240px, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(16, 21, 19, 0.88);
  box-shadow: var(--shadow);
}

.lobby-music-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  border: 1px solid rgba(30, 215, 96, 0.34);
  color: var(--green);
  background: rgba(7, 16, 8, 0.86);
  box-shadow: 0 0 18px rgba(30, 215, 96, 0.18);
}

.lobby-music-button:hover {
  background: rgba(30, 215, 96, 0.14);
}

.lobby-copy {
  display: grid;
  gap: 8px;
}

.join-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.ready-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.ready-squares {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.ready-square {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 2px solid var(--line-strong);
  background: #0b100d;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ready-square.is-ready {
  border-color: var(--green);
  background: var(--green);
  box-shadow: 0 0 10px rgba(30, 215, 96, 0.5);
}

.ready-warning {
  color: var(--amber);
  font-size: 0.85rem;
  font-weight: 700;
}

.ready-warning.is-complete {
  color: var(--green);
}

.ready-card {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  background: #0b100d;
}

.ready-card strong {
  color: var(--text);
}

.ready-card.online {
  border-color: rgba(30, 215, 96, 0.46);
}

.ready-card.online span {
  color: var(--green);
  font-weight: 900;
}

.twitch-panel {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.twitch-panel input {
  width: 180px;
}

.connection-dot {
  display: inline-grid;
  min-height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--muted);
  background: #0b100d;
  font-size: 0.82rem;
  font-weight: 850;
}

.connection-dot.online {
  border-color: rgba(30, 215, 96, 0.45);
  color: var(--green);
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
  padding: 12px;
}

.score-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #0b100d;
}

.score-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-card span {
  color: var(--green);
  font-size: 1.7rem;
  font-weight: 950;
  line-height: 1;
}

.round-intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  visibility: hidden;
  opacity: 1;
  background: transparent;
  pointer-events: none;
  transition: visibility 0s linear 760ms;
}

.round-intro-overlay.active {
  visibility: visible;
  transition-delay: 0s;
}

body.zoom-out-blur-active .round-intro-overlay {
  visibility: visible;
  transition-delay: 0s;
}

.round-intro-overlay::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background: rgba(0, 0, 0, 0);
  opacity: 1;
  backdrop-filter: blur(0);
  transition:
    background-color 260ms ease-out,
    backdrop-filter 260ms ease-out;
}

.round-intro-overlay.no-transition,
.round-intro-overlay.no-transition::before,
.round-intro-overlay.no-transition>div {
  animation: none !important;
  transition: none !important;
}

.round-intro-overlay.active::before {
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(14px);
  transition:
    background-color 760ms cubic-bezier(0.16, 1, 0.3, 1),
    backdrop-filter 760ms cubic-bezier(0.16, 1, 0.3, 1);
}

body.zoom-out-blur-active .round-intro-overlay::before {
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(14px);
  transition:
    background-color 760ms cubic-bezier(0.16, 1, 0.3, 1),
    backdrop-filter 760ms cubic-bezier(0.16, 1, 0.3, 1);
}

.round-intro-overlay>div {
  position: relative;
  z-index: 1;
  color: var(--green);
  font-size: clamp(3.4rem, 13vw, 9.5rem);
  font-weight: 950;
  line-height: 0.9;
  text-shadow: 0 0 34px rgba(30, 215, 96, 0.36);
}

.round-intro-overlay:not(.active)>div {
  visibility: hidden;
  opacity: 0;
  animation: none;
}

.round-intro-overlay.active>div {
  animation: roundIntroIn 780ms cubic-bezier(0.2, 1.35, 0.28, 1) both;
}

.round-intro-overlay.proposal-intro>div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22em;
  justify-content: center;
  max-width: min(1080px, calc(100vw - 32px));
  overflow: visible;
  padding: 0.08em 0.16em 0.18em;
  font-size: clamp(2.7rem, 8vw, 7.4rem);
  letter-spacing: 0.035em;
  line-height: 1.12;
  word-spacing: 0.12em;
  text-align: center;
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity;
}

.proposal-kicker {
  display: inline-block;
  color: var(--green);
  font-weight: 620;
  line-height: 1.12;
  padding: 0.04em 0.08em 0.14em;
  margin: -0.04em -0.08em -0.14em;
  backface-visibility: hidden;
  text-shadow: 0 0 24px rgba(30, 215, 96, 0.28);
  transform: translate3d(0, 0, 0);
  -webkit-font-smoothing: antialiased;
}

.round-intro-overlay.proposal-intro strong {
  display: inline-block;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 750;
  line-height: 1.12;
  padding: 0.04em 0.08em 0.14em;
  margin: -0.04em -0.08em -0.14em;
}

body[data-mode="game"][data-sequence-stage="round-intro"] .round-intro-overlay.active {
  background: transparent;
}

body[data-mode="game"][data-sequence-stage="round-intro"] .round-intro-overlay.active::before {
  background: #050706;
  backdrop-filter: none;
}

@keyframes roundIntroIn {
  from {
    opacity: 0;
    transform: scale(0.74);
  }

  62% {
    transform: scale(1.06);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.game-board {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(340px, 1fr);
  gap: 20px;
  margin-top: 18px;
  padding: 18px;
}

.game-photo-wrap {
  display: grid;
  align-content: center;
  gap: 12px;
  justify-items: center;
  min-width: 0;
}

.photo-person-name {
  min-height: 52px;
  color: #ffffff;
  font-size: clamp(1.7rem, 3.8vw, 3.8rem);
  font-weight: 950;
  line-height: 1.14;
  text-align: center;
}

.proposal-caption {
  position: fixed;
  left: 50%;
  bottom: clamp(18px, 4vh, 42px);
  z-index: 14;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  max-width: min(760px, calc(100vw - 28px));
  overflow: visible;
  border: 1px solid rgba(30, 215, 96, 0.44);
  border-radius: 8px;
  padding: 11px 20px 13px;
  color: var(--green);
  background: rgba(6, 10, 8, 0.78);
  box-shadow: 0 0 28px rgba(30, 215, 96, 0.18);
  font-size: clamp(1.3rem, 3vw, 2.5rem);
  font-weight: 950;
  line-height: 1.14;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
  animation: lowerThirdIn 260ms ease both;
}

.proposal-caption img,
.proposal-avatar-fallback {
  display: grid;
  flex: 0 0 clamp(42px, 7vw, 58px);
  width: clamp(42px, 7vw, 58px);
  height: clamp(42px, 7vw, 58px);
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(30, 215, 96, 0.46);
  border-radius: 50%;
  color: var(--green);
  background: #071008;
  object-fit: cover;
}

.proposal-avatar-fallback {
  font-size: 1rem;
  font-weight: 950;
}

.proposal-caption strong {
  display: block;
  min-width: 0;
  max-width: min(52vw, 520px);
  overflow: hidden;
  padding: 0.08em 0.18em 0.16em;
  margin: -0.08em -0.18em -0.16em;
  line-height: 1.14;
  text-overflow: ellipsis;
  text-shadow: 0 0 12px rgba(30, 215, 96, 0.26);
  white-space: nowrap;
}

.proposal-audio-spectrum {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: clamp(26px, 3.2vw, 36px);
  height: clamp(18px, 2.6vw, 25px);
  filter: drop-shadow(0 0 8px rgba(69, 184, 255, 0.55)) drop-shadow(0 0 16px rgba(69, 184, 255, 0.22));
}

.proposal-audio-spectrum span {
  display: block;
  width: clamp(3px, 0.42vw, 5px);
  height: 42%;
  border-radius: 999px;
  background: linear-gradient(180deg, #8dddff 0%, #45b8ff 58%, #236cff 100%);
  transform-origin: center;
  animation: proposalSpectrumPulse 1400ms ease-in-out infinite;
}

.proposal-audio-spectrum span:nth-child(1) {
  animation-duration: 1650ms;
  animation-delay: -940ms;
}

.proposal-audio-spectrum span:nth-child(2) {
  animation-duration: 1280ms;
  animation-delay: -330ms;
}

.proposal-audio-spectrum span:nth-child(3) {
  animation-duration: 1500ms;
  animation-delay: -820ms;
}

.proposal-audio-spectrum span:nth-child(4) {
  animation-duration: 1180ms;
  animation-delay: -500ms;
}

.proposal-audio-spectrum span:nth-child(5) {
  animation-duration: 1780ms;
  animation-delay: -1240ms;
}

@keyframes proposalSpectrumPulse {

  0%,
  100% {
    height: 28%;
  }

  18% {
    height: 78%;
  }

  36% {
    height: 44%;
  }

  58% {
    height: 100%;
  }

  76% {
    height: 36%;
  }
}

.proposal-caption.hidden {
  display: none;
}

.start-proposals-button {
  position: absolute;
  left: 50%;
  bottom: clamp(14px, 2.2vh, 24px);
  z-index: 6;
  min-height: 46px;
  max-width: calc(100% - 28px);
  padding: 0 18px;
  font-size: 0.98rem;
  white-space: nowrap;
  transform: translateX(-50%);
  animation: startProposalsFadeIn 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
  box-shadow: 0 0 22px rgba(30, 215, 96, 0.34), 0 12px 32px rgba(0, 0, 0, 0.42);
}

.start-proposals-button:hover {
  transform: translateX(-50%) translateY(-1px);
}

@keyframes startProposalsFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(12px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes lowerThirdIn {
  from {
    opacity: 0;
    transform: translate(-50%, 16px);
  }

  68% {
    opacity: 1;
    transform: translate(-50%, -4px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.game-photo {
  width: min(70vh, 100%);
  max-width: 680px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
  transform-origin: center;
  will-change: transform;
}

.game-photo img {
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
  transform-origin: center;
  will-change: transform;
}

body[data-mode="game"] .game-photo img {
  animation: photoMicroShake 2.8s ease-in-out infinite;
}

.game-photo.audio-zoom {
  animation: photoFrameAudioZoom var(--zoom-duration, 10s) linear both;
}

body[data-mode="game"] .game-photo.audio-zoom {
  transition:
    width 520ms cubic-bezier(0.2, 0.8, 0.22, 1),
    max-width 520ms cubic-bezier(0.2, 0.8, 0.22, 1),
    box-shadow 520ms ease,
    filter 760ms ease-out,
    opacity 260ms ease,
    visibility 0s linear 260ms;
}

body[data-mode="game"][data-sequence-stage="proposal-intro"] .game-photo img,
body[data-mode="game"][data-sequence-stage="proposal-active"] .game-photo img {
  animation: none;
  transform: translate3d(0, 0, 0) scale(1.035);
}

.game-photo.photo-reveal-bounce {
  animation: photoRevealBounce 760ms cubic-bezier(0.2, 1.05, 0.24, 1) both;
}

.game-photo.photo-flash-hit {
  animation:
    photoRevealBounce 760ms cubic-bezier(0.2, 1.05, 0.24, 1) both,
    photoFlashHit 760ms ease-out both;
}

.game-photo.vote-ready-flash-hit {
  filter: brightness(1.75) contrast(1.08);
  box-shadow: 0 0 90px rgba(255, 255, 255, 0.58), 0 0 120px rgba(30, 215, 96, 0.25);
}

@keyframes photoFrameAudioZoom {
  from {
    transform: translate3d(0, 0, 0) scale(0.8);
  }

  to {
    transform: translate3d(0, 0, 0) scale(1.1);
  }
}

@keyframes photoMicroShake {

  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1.035);
  }

  25% {
    transform: translate3d(0.38px, -0.32px, 0) rotate(0.045deg) scale(1.035);
  }

  50% {
    transform: translate3d(0, 0.28px, 0) rotate(0deg) scale(1.035);
  }

  75% {
    transform: translate3d(-0.38px, -0.32px, 0) rotate(-0.045deg) scale(1.035);
  }
}

@keyframes photoRevealBounce {
  from {
    opacity: 1;
    transform: scale(0.96);
  }

  74% {
    opacity: 1;
    transform: scale(1.025);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes photoFlashHit {
  0% {
    filter: brightness(1.8) contrast(1.08);
    box-shadow: 0 0 90px rgba(255, 255, 255, 0.58), 0 0 120px rgba(30, 215, 96, 0.25);
  }

  100% {
    filter: brightness(1) contrast(1);
  }
}

.round-badge {
  display: inline-grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green);
  background: #0b100d;
  font-weight: 900;
}

.vote-side {
  display: grid;
  align-content: center;
  gap: 14px;
  min-width: 0;
}

.timer-card {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #0b100d;
}

.timer-ring {
  --progress: 0deg;
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #0b100d 57%, transparent 59%),
    conic-gradient(var(--green) var(--progress), #29352f 0);
}

.timer-ring span {
  font-size: 1.5rem;
  font-weight: 950;
}

.vote-options {
  display: grid;
  gap: 10px;
}

.vote-card {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 74px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #0d1411;
  transition: min-height 220ms ease, padding 220ms ease, transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease, background 220ms ease;
  transform-origin: center;
}

.vote-card:hover {
  border-color: var(--green);
  transform: translateX(2px);
}

.vote-card.is-playing {
  border-color: rgba(30, 215, 96, 0.95);
  background: #101b15;
  box-shadow: 0 0 0 1px rgba(30, 215, 96, 0.38), 0 0 28px rgba(30, 215, 96, 0.24);
  transform: translateX(6px) scale(1.015);
}

.vote-card.is-leading {
  border-color: rgba(74, 255, 142, 0.96);
  background: #102117;
  box-shadow:
    0 0 0 1px rgba(74, 255, 142, 0.38),
    0 0 26px rgba(74, 255, 142, 0.32),
    inset 0 0 24px rgba(74, 255, 142, 0.08);
}

body[data-live-phase="voting"] .vote-card.is-playing,
body[data-live-phase="winner"] .vote-card.is-playing,
body[data-live-phase="finished"] .vote-card.is-playing {
  transform: none;
}

body[data-mode="game"][data-sequence-stage="vote-ready"] .vote-card,
body[data-mode="game"][data-sequence-stage="vote-ready"] .vote-card.is-playing {
  border-color: var(--line);
  box-shadow: none;
  transform: none;
}

body[data-mode="game"][data-sequence-stage="vote-ready"] .vote-card.is-playing .option-copy strong {
  color: inherit;
  font-size: clamp(1.18rem, 2vw, 1.65rem);
  text-shadow: none;
}

body[data-live-phase="voting"] .vote-card.is-leading.is-playing,
body[data-live-phase="winner"] .vote-card.is-leading.is-playing,
body[data-live-phase="finished"] .vote-card.is-leading.is-playing {
  box-shadow:
    0 0 0 1px rgba(74, 255, 142, 0.38),
    0 0 26px rgba(74, 255, 142, 0.32),
    inset 0 0 24px rgba(74, 255, 142, 0.08);
}

.vote-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--vote-width, 0%);
  height: 100%;
  background: linear-gradient(90deg, rgba(30, 215, 96, 0.42), rgba(30, 215, 96, 0.13));
  opacity: 0;
  transition: width 260ms ease, opacity 180ms ease;
  z-index: 0;
}

.vote-card.is-leading .vote-fill {
  background: linear-gradient(90deg, rgba(74, 255, 142, 0.62), rgba(30, 215, 96, 0.2));
  box-shadow: inset 0 0 22px rgba(177, 255, 205, 0.16);
}

.option-avatar {
  position: relative;
  z-index: 1;
  display: grid;
  width: var(--vote-avatar-size, 44px);
  height: var(--vote-avatar-size, 44px);
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(30, 215, 96, 0.5);
  border-radius: 50%;
  color: var(--green);
  background: #071008;
  box-shadow: 0 0 18px rgba(30, 215, 96, 0.16);
  font-weight: 950;
  transition: width 220ms ease, height 220ms ease, box-shadow 220ms ease;
}

.option-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.option-avatar span {
  font-size: 0.88rem;
}

.option-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  overflow: visible;
}

.option-copy strong,
.option-copy span {
  display: block;
  overflow: hidden;
  padding: 0.08em 0.16em 0.16em;
  margin: -0.08em -0.16em -0.16em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.option-copy strong {
  font-size: clamp(1.18rem, 2vw, 1.65rem);
  line-height: 1.16;
}

.vote-card.is-playing .option-copy strong {
  color: var(--green);
  font-size: clamp(1.45rem, 2.5vw, 2.1rem);
  line-height: 1.16;
  text-shadow: 0 0 18px rgba(30, 215, 96, 0.2);
}

.option-copy span {
  display: none;
}

.vote-count {
  position: relative;
  z-index: 1;
  display: block;
  min-width: 2.2ch;
  color: var(--green);
  font-size: 1.4rem;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  text-align: right;
}

body[data-live-phase="voting"] .vote-count,
body[data-live-phase="winner"] .vote-count,
body[data-live-phase="finished"] .vote-count {
  opacity: 1;
}

body[data-live-phase="voting"] .vote-fill,
body[data-live-phase="winner"] .vote-fill,
body[data-live-phase="finished"] .vote-fill {
  opacity: 1;
}

body[data-live-phase="voting"] .vote-card,
body[data-live-phase="winner"] .vote-card,
body[data-live-phase="finished"] .vote-card {
  z-index: calc(1 + var(--vote-lift, 0));
  min-height: var(--vote-card-height, 68px);
  padding-top: calc(11px + var(--vote-padding-boost, 0px));
  padding-bottom: calc(11px + var(--vote-padding-boost, 0px));
  transform: none;
}

body[data-live-phase="voting"] .vote-card:hover,
body[data-live-phase="winner"] .vote-card:hover,
body[data-live-phase="finished"] .vote-card:hover {
  transform: none;
}

body[data-live-phase="voting"] .option-copy strong,
body[data-live-phase="winner"] .option-copy strong,
body[data-live-phase="finished"] .option-copy strong {
  transform: scale(var(--vote-name-scale, 1));
  transform-origin: left center;
  transition: transform 220ms ease, color 220ms ease;
}

.vote-card .icon-button {
  display: none;
}

.round-actions {
  display: grid;
  place-items: center;
  min-height: 70px;
}

.vote-hint {
  justify-self: center;
  max-width: min(720px, 100%);
  overflow: hidden;
  border: 1px solid rgba(30, 215, 96, 0.34);
  border-radius: 8px;
  padding: 9px 14px;
  color: var(--green);
  background: rgba(6, 10, 8, 0.78);
  box-shadow: 0 0 22px rgba(30, 215, 96, 0.12);
  font-size: clamp(0.95rem, 1.8vw, 1.3rem);
  font-weight: 900;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(12px);
}

.vote-start-button {
  min-height: 58px;
  min-width: min(340px, 100%);
  font-size: clamp(1.2rem, 2.4vw, 2rem);
  font-weight: 950;
  box-shadow: 0 0 22px rgba(30, 215, 96, 0.32), 0 0 70px rgba(30, 215, 96, 0.12);
}

.game-footer {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
  padding: 12px;
}

.chat-feed {
  display: flex;
  min-height: 42px;
  gap: 8px;
  overflow: hidden;
  align-items: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.chat-message {
  flex: 0 0 auto;
  max-width: 260px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #0b100d;
}

.winner-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
}

.winner-overlay.active {
  display: grid;
}

.winner-overlay>div {
  width: min(760px, 100%);
  border: 1px solid rgba(30, 215, 96, 0.42);
  border-radius: 8px;
  padding: 28px 34px 30px;
  text-align: center;
  background: #0b100d;
  animation: winnerIn 320ms cubic-bezier(0.2, 0.9, 0.2, 1.2) both;
}

.winner-crown {
  margin-top: 8px;
  color: var(--amber);
  font-size: 1.55rem;
  line-height: 1;
  text-shadow: 0 0 16px rgba(255, 200, 87, 0.28);
}

.winner-overlay h2 {
  margin: 10px 0 22px;
  overflow: hidden;
  color: var(--green);
  font-size: 2.75rem;
  line-height: 1.04;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.winner-overlay p {
  color: var(--muted);
}

@keyframes winnerIn {
  from {
    opacity: 0;
    transform: scale(0.82);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

#confettiLayer {
  position: fixed;
  inset: 0;
  z-index: 40;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

body[data-mode="game"] .topbar,
body[data-mode="game"] .game-topline,
body[data-mode="game"] .scoreboard {
  display: none;
}

body[data-mode="game"] {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

body[data-mode="game"]::before {
  content: "";
  position: fixed;
  inset: -35vmax;
  z-index: 0;
  opacity: 0.24;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px);
  background-size: 132px 132px;
  transform: rotate(-16deg) scale(1.15);
  animation: gameGridDrift 18s linear infinite;
}

body[data-mode="game"].photo-flash-active::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 24;
  pointer-events: none;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.52) 28%, rgba(255, 255, 255, 0.12) 58%, transparent 78%),
    rgba(255, 255, 255, 0.32);
  mix-blend-mode: screen;
  animation: photoFlashFade 920ms ease-out both;
}

body[data-mode="game"].photo-flash-active .game-photo.photo-reveal-visible {
  position: relative;
  z-index: 26;
}

body[data-mode="game"].photo-flash-active .game-photo.vote-ready-flash-hit {
  position: relative;
  z-index: 26;
}

body[data-mode="game"].photo-flash-active[data-sequence-stage="vote-ready"] .game-photo {
  position: relative;
  z-index: 26;
}

@keyframes gameGridDrift {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 132px 132px;
  }
}

@keyframes photoFlashFade {
  0% {
    opacity: 0;
  }

  8% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

html:has(body[data-mode="game"]) {
  height: 100%;
  overflow: hidden;
}

body[data-mode="game"] .app-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.game-reset-button {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 18;
  min-height: 32px;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 900;
  opacity: 0.72;
}

.game-reset-button:hover {
  opacity: 1;
}

body[data-mode="game"] #panel-game {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body[data-mode="game"] .lobby-panel {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  border: 0;
  margin-top: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

body[data-mode="game"] .start-panel {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
}

body[data-mode="game"] .game-board {
  position: relative;
  grid-template-columns: 1fr;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  align-items: center;
  border: 0;
  margin-top: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}

body[data-mode="game"] .game-photo-wrap {
  min-height: 0;
  height: 100vh;
  height: 100dvh;
  align-content: center;
  padding: clamp(14px, 2.5vh, 30px) 16px clamp(70px, 10vh, 116px);
}

body[data-mode="game"][data-sequence-stage="round-intro"] .game-photo-wrap {
  opacity: 0;
  visibility: hidden;
}

body[data-mode="game"] .photo-person-name {
  position: static;
  max-width: min(900px, calc(100vw - 32px));
  min-height: 1.24em;
  overflow: hidden;
  padding: 0.08em 0.2em 0.18em;
  margin: -0.08em -0.2em -0.18em;
  color: #ffffff;
  font-size: clamp(1.35rem, 3.4vw, 3.4rem);
  line-height: 1.14;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: none;
}

body[data-mode="game"][data-sequence-stage="photo-reveal"] .photo-person-name:not(.hidden) {
  z-index: 28;
}

body[data-mode="game"][data-photo-reveal-step="typing"] .photo-person-name,
body[data-mode="game"][data-photo-reveal-step="waiting"] .photo-person-name {
  position: fixed;
  left: 50%;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(560px, calc(100vw - 36px));
  max-width: min(780px, calc(100vw - 36px));
  min-height: clamp(70px, 10vh, 112px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: clamp(14px, 3vw, 24px) clamp(18px, 4vw, 34px);
  color: #ffffff;
  background: rgba(5, 8, 7, 0.82);
  box-shadow: 0 0 34px rgba(255, 255, 255, 0.1), 0 0 54px rgba(30, 215, 96, 0.12);
  font-size: clamp(1.55rem, 4.6vw, 4.4rem);
  line-height: 1.14;
  overflow: visible;
  text-overflow: clip;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.34), 0 0 28px rgba(30, 215, 96, 0.18);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(14px);
}

.typewriter-text {
  display: inline-block;
  min-width: 1ch;
  max-width: none;
  overflow: visible;
  padding: 0.08em 0.18em 0.18em;
  margin: -0.08em -0.18em -0.18em;
  line-height: 1.14;
  text-overflow: clip;
  white-space: nowrap;
  vertical-align: middle;
}

.typewriter-cursor {
  display: inline-block;
  position: relative;
  flex: 0 0 auto;
  width: 0.08em;
  height: 0.86em;
  margin-left: 0.18em;
  overflow: hidden;
  color: transparent;
  animation: typeCursorBlink 760ms steps(1) infinite;
}

.typewriter-cursor::before {
  content: "";
  position: absolute;
  inset: 0.05em 0 auto 0;
  width: 2px;
  height: 0.78em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

@keyframes typeCursorBlink {

  0%,
  48% {
    opacity: 1;
  }

  49%,
  100% {
    opacity: 0;
  }
}

body[data-mode="game"][data-photo-reveal-step="typing"] .game-photo,
body[data-mode="game"][data-photo-reveal-step="waiting"] .game-photo {
  opacity: 0;
  visibility: hidden;
}

body[data-mode="game"].photo-pre-reveal-visible[data-photo-reveal-step="waiting"] .game-photo.photo-reveal-visible {
  opacity: 1;
  visibility: visible;
}

body[data-mode="game"][data-sequence-stage="photo-reveal"] .game-photo:not(.photo-reveal-visible) {
  opacity: 0;
  visibility: hidden;
}

body[data-mode="game"][data-photo-reveal-step="photo"] .photo-person-name:not(.hidden) {
  position: relative;
  max-width: min(900px, calc(100vw - 32px));
  margin-bottom: clamp(4px, 1vh, 12px);
  color: #ffffff;
  font-size: clamp(1.35rem, 3.4vw, 3.4rem);
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.28), 0 0 26px rgba(30, 215, 96, 0.14);
  animation: photoNameRiseTop 520ms cubic-bezier(0.18, 1.24, 0.28, 1) both;
}

body[data-mode="game"][data-photo-reveal-step="photo"]:not(.photo-name-visible) .photo-person-name:not(.hidden) {
  visibility: hidden;
  opacity: 0;
  animation: none;
}

body[data-mode="game"][data-photo-reveal-step="photo"].photo-name-visible .photo-person-name:not(.hidden) {
  visibility: visible;
  animation: photoNameDelayedIn 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

body[data-mode="game"][data-photo-reveal-step="photo"] .game-photo-wrap {
  gap: clamp(8px, 1.5vh, 16px);
}

body[data-mode="game"] .game-photo {
  width: min(86vmin, 920px);
  max-width: calc(100vw - 32px);
  box-shadow: 0 0 52px rgba(30, 215, 96, 0.12), 0 32px 90px rgba(0, 0, 0, 0.5);
  transition:
    width 520ms cubic-bezier(0.2, 0.8, 0.22, 1),
    max-width 520ms cubic-bezier(0.2, 0.8, 0.22, 1),
    transform 520ms cubic-bezier(0.2, 0.8, 0.22, 1),
    box-shadow 520ms ease,
    filter 760ms ease-out,
    opacity 260ms ease,
    visibility 0s linear 260ms;
}

body[data-mode="game"][data-sequence-stage="proposal-intro"] .game-photo-wrap,
body[data-mode="game"][data-sequence-stage="proposal-active"] .game-photo-wrap {
  gap: 8px;
  padding-top: clamp(8px, 1.5vh, 18px);
}

body[data-mode="game"][data-sequence-stage="vote-ready"] .game-photo-wrap,
body[data-mode="game"][data-live-phase="voting"] .game-photo-wrap,
body[data-mode="game"][data-live-phase="winner"] .game-photo-wrap,
body[data-mode="game"][data-live-phase="finished"] .game-photo-wrap {
  gap: 8px;
  padding-top: clamp(8px, 1.5vh, 18px);
  padding-bottom: clamp(156px, 22vh, 230px);
}

body[data-mode="game"][data-sequence-stage="proposal-intro"] .photo-person-name,
body[data-mode="game"][data-sequence-stage="proposal-active"] .photo-person-name {
  font-size: clamp(0.95rem, 1.9vw, 1.85rem);
  opacity: 0.82;
}

body[data-mode="game"][data-sequence-stage="vote-ready"] .photo-person-name,
body[data-mode="game"][data-live-phase="voting"] .photo-person-name,
body[data-mode="game"][data-live-phase="winner"] .photo-person-name,
body[data-mode="game"][data-live-phase="finished"] .photo-person-name {
  font-size: clamp(0.95rem, 1.9vw, 1.85rem);
  opacity: 0.9;
}

body[data-mode="game"][data-sequence-stage="proposal-intro"] .game-photo,
body[data-mode="game"][data-sequence-stage="proposal-active"] .game-photo {
  width: min(84vmin, 980px);
  box-shadow: 0 0 72px rgba(30, 215, 96, 0.16), 0 36px 110px rgba(0, 0, 0, 0.62);
}

body[data-mode="game"][data-sequence-stage="proposal-intro"] .game-photo {
  transform: translate3d(0, 0, 0) scale(0.8);
}

body[data-mode="game"][data-sequence-stage="vote-ready"] .game-photo,
body[data-mode="game"][data-live-phase="voting"] .game-photo,
body[data-mode="game"][data-live-phase="winner"] .game-photo,
body[data-mode="game"][data-live-phase="finished"] .game-photo {
  width: min(62vmin, 760px);
  box-shadow: 0 0 64px rgba(30, 215, 96, 0.14), 0 34px 100px rgba(0, 0, 0, 0.58);
}

@keyframes photoNameReveal {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
  }

  64% {
    opacity: 1;
    transform: translateY(2px) scale(1.03);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes photoNameRiseTop {
  from {
    opacity: 0.9;
    transform: translateY(10px) scale(0.94);
  }

  64% {
    opacity: 1;
    transform: translateY(-4px) scale(1.045);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes photoNameDelayedIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

body[data-mode="game"] .round-badge {
  display: none;
}

body[data-mode="game"] .vote-side {
  position: fixed;
  left: 50%;
  bottom: clamp(16px, 4vh, 42px);
  z-index: 13;
  display: none;
  width: min(980px, calc(100vw - 28px));
  transform: translateX(-50%);
}

body[data-mode="game"][data-sequence-stage="vote-ready"] .vote-side,
body[data-mode="game"][data-live-phase="voting"] .vote-side,
body[data-mode="game"][data-live-phase="winner"] .vote-side,
body[data-mode="game"][data-live-phase="finished"] .vote-side {
  display: grid;
}

body[data-mode="game"] .vote-options {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body[data-mode="game"] .vote-card {
  min-height: var(--vote-card-height, 68px);
  padding-top: calc(11px + var(--vote-padding-boost, 0px));
  padding-bottom: calc(11px + var(--vote-padding-boost, 0px));
  background: rgba(13, 20, 17, 0.88);
  backdrop-filter: blur(12px);
}

body[data-mode="game"] .round-actions {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 2;
  width: min(360px, 100%);
  min-height: 0;
  transform: translateX(-50%);
}

body[data-mode="game"] .vote-card:nth-child(2) {
  animation-delay: 45ms;
}

body[data-mode="game"] .vote-card:nth-child(3) {
  animation-delay: 90ms;
}

body[data-mode="game"] .vote-card:nth-child(4) {
  animation-delay: 135ms;
}

@keyframes voteCardPop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.94);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

body[data-mode="game"] .game-footer {
  display: none;
}

body[data-mode="game"] .timer-card,
body[data-mode="game"] .game-footer {
  box-shadow: none;
}

@media (max-width: 980px) {

  .topbar,
  .admin-layout,
  .two-columns,
  .lobby-panel,
  .editor-stage,
  .game-board {
    grid-template-columns: 1fr;
  }

  .topbar {
    position: static;
  }

  .view-tabs {
    justify-content: stretch;
    overflow-x: auto;
  }

  .route-links {
    justify-content: stretch;
    overflow-x: auto;
  }

  .route-link {
    flex: 1 0 auto;
  }

  .tab-button {
    flex: 1 0 auto;
  }

  .save-pill {
    justify-self: stretch;
  }

  .intro-band,
  .game-topline {
    align-items: stretch;
    flex-direction: column;
  }

  .fill-layout {
    grid-template-columns: 1fr;
  }

  .round-strip {
    display: flex;
    max-height: none;
    overflow-x: auto;
    padding: 0 0 8px;
  }

  .scoreboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(1440px, calc(100% - 20px));
    padding-top: 10px;
  }

  body[data-mode="titles"][data-identity-ready="false"] .app-shell,
  body[data-mode="titles"][data-identity-ready="false"] main,
  body[data-mode="titles"][data-identity-ready="false"] #panel-titles {
    width: 100%;
    max-width: 100%;
  }

  body[data-mode="titles"][data-identity-ready="false"] .identity-panel {
    width: 100%;
    justify-items: stretch;
    padding: 0 16px;
  }

  body[data-mode="titles"][data-identity-ready="false"] .identity-card {
    max-width: none;
    padding: 22px;
  }

  .identity-card h2 {
    font-size: clamp(1.55rem, 8vw, 2.15rem);
  }

  .brand-block {
    align-items: start;
  }

  .photo-grid,
  .scoreboard {
    grid-template-columns: 1fr;
  }

  .timer-card,
  .saved-clip,
  .channel-card,
  .fill-toolbar,
  .twitch-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .winner-overlay>div {
    padding: 24px 18px 26px;
  }

  .winner-overlay h2 {
    font-size: 1.65rem;
  }

  .identity-avatar-picker {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .identity-avatar-preview {
    width: 64px;
    height: 64px;
  }

  .player-profile-card {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .top-profile-controls {
    justify-self: stretch;
    justify-content: flex-end;
  }

  .ghost-button.top-profile-edit {
    min-height: 30px;
    padding: 0 9px;
    font-size: 0.74rem;
  }

  .vote-card {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .vote-card .icon-button {
    grid-column: 2;
    justify-self: start;
  }

  .vote-count {
    grid-column: 2;
  }

  body[data-mode="game"] .vote-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-mode="game"] .vote-card {
    grid-template-columns: 34px minmax(0, 1fr);
    min-height: min(var(--vote-card-height, 60px), 84px);
    padding: calc(9px + var(--vote-padding-boost, 0px)) 9px;
  }

  body[data-mode="game"] .option-avatar {
    width: min(var(--vote-avatar-size, 34px), 42px);
    height: min(var(--vote-avatar-size, 34px), 42px);
  }

  .inline-error {
    display: none;
    margin-top: 4px;
    color: #ff4444;
    font-size: 0.78rem;
    font-weight: 600;
  }
}