:root {
  --font-head: 'Bebas Neue', system-ui, sans-serif;
  --font-body: 'Space Grotesk', system-ui, sans-serif;
  --bg-0: #0b0f1f;
  --bg-1: #0f1630;
  --bg-2: #141c3a;
  --card: rgba(20, 27, 52, 0.7);
  --card-strong: rgba(18, 24, 48, 0.9);
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 18px 40px rgba(3, 7, 20, 0.45);
  --text: #f3f5ff;
  --muted: rgba(243, 245, 255, 0.6);
  --accent: #6dd5ff;
  --accent-2: #8b5cff;
  --danger: #ff5f7a;
  --success: #5cffb0;
  --warning: #ffcc66;
  --glow: 0 0 30px rgba(109, 213, 255, 0.2);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

body[data-theme='light'] {
  --bg-0: #eef2ff;
  --bg-1: #f6f8ff;
  --bg-2: #ffffff;
  --card: rgba(255, 255, 255, 0.85);
  --card-strong: rgba(255, 255, 255, 0.95);
  --border: rgba(20, 30, 60, 0.12);
  --shadow: 0 18px 40px rgba(22, 33, 66, 0.18);
  --text: #0b1024;
  --muted: rgba(11, 16, 36, 0.55);
  --glow: 0 0 24px rgba(108, 88, 255, 0.2);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: radial-gradient(circle at top, rgba(109, 213, 255, 0.08), transparent 40%),
    radial-gradient(circle at 20% 20%, rgba(139, 92, 255, 0.12), transparent 35%),
    linear-gradient(145deg, var(--bg-0), var(--bg-1) 45%, var(--bg-2));
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

.app {
  width: min(1200px, 92vw);
  margin: 0 auto;
  padding: 24px 0 60px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  margin: 16px 0 28px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-head);
  font-size: 28px;
  letter-spacing: 1px;
}

.badge {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  background: linear-gradient(135deg, #ffb347, #ffcc33, #ff8f5c);
  color: #201205;
  box-shadow: 0 10px 24px rgba(255, 160, 70, 0.4);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

#userArea {
  display: flex;
  align-items: center;
  gap: 16px;
}

.link {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: 0.2s ease;
}

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

.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--card-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.user-chip .name {
  font-weight: 600;
}

.user-chip .meta {
  font-size: 13px;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  text-transform: uppercase;
}

.pill.accent {
  background: linear-gradient(135deg, rgba(109, 213, 255, 0.18), rgba(139, 92, 255, 0.18));
  border-color: rgba(109, 213, 255, 0.4);
}

.hero {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-head);
  font-size: clamp(36px, 5vw, 64px);
  letter-spacing: 1.5px;
}

.hero p {
  margin: 0;
  max-width: 700px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 24px;
}

.filters .pill {
  cursor: pointer;
  transition: 0.2s ease;
}

.filters .pill.active {
  background: linear-gradient(135deg, rgba(109, 213, 255, 0.3), rgba(139, 92, 255, 0.3));
  border-color: rgba(109, 213, 255, 0.6);
  color: var(--text);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.game-card {
  position: relative;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  overflow: hidden;
  min-height: 210px;
  display: grid;
  gap: 12px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  cursor: pointer;
}

.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, var(--card-accent), transparent 55%);
  opacity: 0.9;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.game-card::after {
  content: '';
  position: absolute;
  inset: -20%;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.18), transparent 70%);
  opacity: 0;
  transform: translateX(-30%);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.6s ease;
}

.game-card:hover,
.game-card:focus-within,
.game-card:active,
.game-card.hovering {
  transform: translateY(-6px) scale(1.01);
  border-color: rgba(109, 213, 255, 0.5);
  box-shadow: 0 24px 50px rgba(3, 7, 20, 0.6);
}

.game-card:hover::before,
.game-card:focus-within::before,
.game-card:active::before,
.game-card.hovering::before {
  opacity: 1;
  transform: scale(1.02);
}

.game-card:hover::after,
.game-card:focus-within::after,
.game-card:active::after,
.game-card.hovering::after {
  opacity: 1;
  transform: translateX(30%);
}

@media (hover: none) {
  .game-card:active {
    transform: translateY(-4px) scale(1.01);
  }
}

.game-card h3 {
  margin: 0;
  font-family: var(--font-head);
  font-size: 26px;
  letter-spacing: 1px;
}

.game-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.game-card .vote-count {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.game-card .card-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.game-card .cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text);
}

.vote-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: 0.2s ease;
}

.vote-btn:hover {
  border-color: rgba(109, 213, 255, 0.6);
}

.vote-btn.voted {
  border-color: rgba(109, 213, 255, 0.65);
  background: linear-gradient(135deg, rgba(109, 213, 255, 0.28), rgba(139, 92, 255, 0.28));
  color: var(--text);
}

.vote-btn.closed {
  opacity: 0.62;
}

.vote-btn.closed:hover {
  border-color: var(--border);
}

button,
.btn {
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #041024;
  box-shadow: var(--glow);
}

.btn.primary:hover {
  transform: translateY(-1px);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn.ghost:hover {
  border-color: rgba(109, 213, 255, 0.6);
}

.btn.warn {
  background: linear-gradient(135deg, #ffac6f, #ff5f7a);
  color: #190a0d;
}

.layout-split {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 22px;
}

.game-layout {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 22px;
}

.stage {
  padding: 22px;
  display: grid;
  gap: 18px;
  position: relative;
  overflow: hidden;
}

.stage::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, var(--accent, #6dd5ff), transparent 55%),
    radial-gradient(circle at bottom right, var(--accent-2, #8b5cff), transparent 55%);
  opacity: 0.18;
  pointer-events: none;
}

.stage > * {
  position: relative;
}

.stage-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.stage-header h1 {
  margin: 0;
  font-family: var(--font-head);
  font-size: 36px;
  letter-spacing: 1px;
}

.stage-header p {
  margin: 6px 0 0;
  color: var(--muted);
  max-width: 520px;
}

.stage-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.stage-actions .stat {
  font-size: 14px;
  color: var(--muted);
}

.side {
  display: grid;
  gap: 18px;
}

.side .card {
  padding: 18px;
}

.side h3 {
  margin: 0 0 10px;
  font-size: 18px;
  letter-spacing: 0.4px;
}

.side ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 8px;
}

.game-root {
  min-height: 380px;
  display: grid;
  place-items: center;
  gap: 16px;
}

.notice {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 13px;
}

.global-announcement {
  margin: -10px 0 18px;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
  border-color: rgba(109, 213, 255, 0.45);
  background: linear-gradient(145deg, rgba(22, 29, 56, 0.86), rgba(20, 28, 49, 0.78));
}

.global-announcement-text {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.global-announcement-author {
  color: var(--muted);
  font-size: 12px;
}

.global-announcement-time {
  font-size: 12px;
  color: var(--muted);
}

.global-announcement-reactions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.reaction-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.reaction-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(109, 213, 255, 0.45);
}

.reaction-btn.active {
  border-color: rgba(109, 213, 255, 0.65);
  background: rgba(109, 213, 255, 0.2);
}

.game-chat-card {
  display: grid;
  gap: 10px;
}

.game-chat-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  padding: 10px;
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.game-chat-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
}

.game-chat-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #0b1024;
}

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

.game-chat-bubble {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  gap: 4px;
}

.game-chat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}

.game-chat-meta strong {
  color: var(--text);
  font-size: 12px;
}

.game-chat-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chat-report-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}

.chat-report-btn:hover:not(:disabled) {
  border-color: rgba(255, 95, 122, 0.45);
  color: #ffd8df;
}

.chat-report-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.game-chat-text {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.game-chat-form {
  display: flex;
  gap: 8px;
}

.game-chat-form input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: var(--font-body);
}

.game-chat-status-error {
  border-color: rgba(255, 95, 122, 0.5);
  color: #ffd8df;
  background: rgba(255, 95, 122, 0.14);
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 22, 0.72);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.overlay.active {
  display: flex;
}

body.legacy-domain-lock .app {
  pointer-events: none;
  user-select: none;
  filter: blur(5px) saturate(0.7);
}

.legacy-domain-overlay {
  z-index: 2000;
  background: rgba(5, 8, 20, 0.88);
}

.legacy-domain-popup {
  width: min(640px, 92vw);
  padding: 24px;
  text-align: center;
  display: grid;
  gap: 14px;
}

.legacy-domain-popup h2 {
  margin: 0;
  font-family: var(--font-head);
  font-size: 42px;
  letter-spacing: 0.8px;
}

.legacy-domain-popup p {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}

.auth-modal {
  width: min(420px, 92vw);
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--card-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

.auth-tabs {
  display: flex;
  gap: 10px;
}

.auth-tabs button {
  flex: 1;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 13px;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: var(--font-body);
}

.field input::placeholder {
  color: rgba(243, 245, 255, 0.4);
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--card-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: none;
  z-index: 50;
  max-width: 280px;
}

.toast.show {
  display: block;
}

.section {
  display: grid;
  gap: 12px;
}

.section h2 {
  margin: 0;
  font-family: var(--font-head);
  font-size: 30px;
  letter-spacing: 1px;
}

.admin-panel {
  display: grid;
  gap: 12px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-status-error {
  border-color: rgba(255, 95, 122, 0.5);
  color: #ffd8df;
  background: rgba(255, 95, 122, 0.14);
}

.admin-player-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
  padding-right: 4px;
}

.admin-player-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.admin-player-name {
  color: var(--text);
  font-weight: 600;
}

.admin-player-meta {
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

.admin-timer-list .admin-player-row {
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.admin-timer-list .admin-player-row:hover {
  transform: translateY(-1px);
  border-color: rgba(109, 213, 255, 0.5);
  background: rgba(109, 213, 255, 0.12);
}

.profile-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 22px;
}

.profile-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 20px;
}

.avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(109, 213, 255, 0.6), rgba(139, 92, 255, 0.6));
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  font-size: 34px;
  color: #0b1024;
  overflow: hidden;
}

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

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.stat-card {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
}

.stat-card .label {
  font-size: 12px;
  color: var(--muted);
}

.stat-card .value {
  font-size: 20px;
  font-weight: 600;
}

.list {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 13px;
}

.chip.locked {
  opacity: 0.5;
}

.chip.selected {
  background: linear-gradient(135deg, rgba(109, 213, 255, 0.35), rgba(139, 92, 255, 0.35));
  border-color: rgba(109, 213, 255, 0.6);
  color: var(--text);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
}

.table th {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.player-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  flex: 0 0 auto;
}

.player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.empty {
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  text-align: center;
  color: var(--muted);
}

/* Game specific */
.click-rush {
  display: grid;
  gap: 16px;
  justify-items: center;
  width: 100%;
}

.hud {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.hud-item {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
}

.click-btn {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 8px solid rgba(255, 255, 255, 0.1);
  background: radial-gradient(circle at top, rgba(109, 213, 255, 0.6), rgba(139, 92, 255, 0.6));
  color: #051122;
  font-family: var(--font-head);
  font-size: 32px;
  box-shadow: var(--glow);
  display: grid;
  place-items: center;
}

.connect4 {
  width: 100%;
  display: grid;
  gap: 12px;
}

.connect4-board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: rgba(5, 9, 24, 0.65);
}

.connect4-cell {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

.connect4-cell.player::after,
.connect4-cell.cpu::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  animation: drop 0.3s ease;
}

.connect4-cell.player::after {
  background: linear-gradient(135deg, #6dd5ff, #8b5cff);
}

.connect4-cell.cpu::after {
  background: linear-gradient(135deg, #ffb347, #ff5f7a);
}

@keyframes drop {
  from {
    transform: translateY(-120%);
  }
  to {
    transform: translateY(0);
  }
}

.rps {
  display: grid;
  gap: 16px;
  text-align: center;
}

.rps-hands {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 150px;
}

.rps-hands.shake {
  animation: shake 0.5s ease infinite;
}

@keyframes shake {
  0% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

.rps-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.rps-online {
  display: grid;
  gap: 14px;
}

.rps-online-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.rps-online-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.rps-online-players {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}

.online-player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
}

.online-avatar {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(109, 213, 255, 0.55), rgba(139, 92, 255, 0.55));
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  color: #091020;
  font-size: 24px;
  overflow: hidden;
}

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

.online-meta {
  display: grid;
  gap: 2px;
}

.online-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.2px;
}

.online-role {
  color: var(--muted);
  font-size: 12px;
}

.rps-online-vs {
  font-family: var(--font-head);
  font-size: 30px;
  color: var(--muted);
  letter-spacing: 1px;
}

.rps-online-hands {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.rps-online-hand {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 12px;
  display: grid;
  justify-items: center;
  gap: 4px;
}

.rps-online-hand span {
  font-size: clamp(62px, 10vw, 96px);
  line-height: 1;
}

.rps-online-hand small {
  color: var(--muted);
  font-size: 12px;
}

.rps-online-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.click-rush-online {
  display: grid;
  gap: 14px;
  justify-items: stretch;
}

.click-rush-online .click-btn {
  margin: 0 auto;
}

.click-rush-online .click-btn:disabled {
  cursor: not-allowed;
  filter: grayscale(0.4);
  opacity: 0.6;
}

.memory-online {
  display: grid;
  gap: 14px;
}

.memory-online-grid {
  grid-template-columns: repeat(4, 1fr);
  width: min(560px, 100%);
  margin: 0 auto;
}

.memory-online-card {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.memory-online-card:disabled {
  cursor: not-allowed;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  width: min(600px, 100%);
}

.memory-grid.shuffling .memory-card {
  animation: mem-shuffle 0.45s ease-in-out;
}

@keyframes mem-shuffle {
  0% {
    transform: scale(1) rotate(0deg);
  }
  40% {
    transform: scale(0.92) rotate(-3deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

.memory-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  perspective: 800px;
  min-height: 90px;
}

.memory-inner {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  transform-style: preserve-3d;
  transition: transform 0.4s ease;
}

.memory-card.flipped .memory-inner {
  transform: rotateY(180deg);
}

.memory-face {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  backface-visibility: hidden;
  display: grid;
  place-items: center;
  font-size: 34px;
  border: 1px solid var(--border);
}

.memory-front {
  background: rgba(255, 255, 255, 0.08);
}

body[data-theme='light'] .memory-front {
  background: rgba(11, 16, 36, 0.08);
}

.memory-back {
  background: linear-gradient(135deg, rgba(109, 213, 255, 0.6), rgba(139, 92, 255, 0.6));
  color: #031225;
  transform: rotateY(180deg);
}

.canvas-wrap {
  position: relative;
  width: min(520px, 100%);
}

.canvas-wrap canvas {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  background: rgba(5, 9, 24, 0.7);
  border: 1px solid var(--border);
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  background: rgba(5, 9, 24, 0.7);
  backdrop-filter: blur(4px);
  color: var(--text);
  border-radius: var(--radius-md);
}

.game-overlay.show {
  display: flex;
}

.tetris-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
}

.tetris-stats {
  display: grid;
  gap: 10px;
}

.dino-embed,
.unblocked-embed {
  width: 100%;
  display: grid;
  gap: 12px;
}

.embed-shell {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  background: rgba(10, 14, 28, 0.6);
  position: relative;
}

.embed-frame {
  width: 100%;
  height: 420px;
  border: 0;
  background: rgba(10, 14, 28, 0.6);
}

.embed-shell:fullscreen,
.embed-shell:-webkit-full-screen {
  border-radius: 0;
  border: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.embed-shell:fullscreen .embed-frame,
.embed-shell:-webkit-full-screen .embed-frame {
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
}

.embed-fs-overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.embed-shell:fullscreen .embed-fs-overlay,
.embed-shell:-webkit-full-screen .embed-fs-overlay {
  opacity: 1;
}

.embed-fs-announcement,
.embed-fs-chat {
  position: absolute;
  border: 1px solid rgba(109, 213, 255, 0.45);
  border-radius: 14px;
  background: rgba(7, 12, 30, 0.78);
  backdrop-filter: blur(10px);
  color: #f3f5ff;
  box-shadow: 0 12px 34px rgba(2, 6, 18, 0.55);
}

.embed-fs-announcement {
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(900px, calc(100vw - 36px));
  padding: 10px 14px;
}

.embed-fs-chat {
  right: 14px;
  bottom: 14px;
  width: min(420px, calc(100vw - 36px));
  max-height: min(45vh, 360px);
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}

.embed-fs-title {
  font-family: var(--font-head);
  letter-spacing: 0.5px;
  font-size: 20px;
  color: #9fdfff;
}

.embed-fs-announcement-text {
  font-size: 13px;
  line-height: 1.45;
  color: #f3f5ff;
}

.embed-fs-chat-list {
  display: grid;
  gap: 6px;
  overflow: auto;
  max-height: min(35vh, 270px);
  padding-right: 2px;
}

.embed-fs-chat-line,
.embed-fs-chat-empty {
  font-size: 12px;
  line-height: 1.4;
  padding: 6px 8px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #f3f5ff;
  word-break: break-word;
}

.embed-fs-chat-empty {
  color: rgba(243, 245, 255, 0.7);
}

.embed-popup {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(92%, 520px);
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(109, 213, 255, 0.5);
  background: rgba(9, 14, 31, 0.92);
  color: var(--text);
  box-shadow: 0 12px 28px rgba(2, 6, 18, 0.55);
  backdrop-filter: blur(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.embed-popup.hide {
  opacity: 0;
  transform: translate(-50%, -8px);
  pointer-events: none;
}

.embed-popup-close {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
}

.embed-popup-close:hover {
  border-color: rgba(109, 213, 255, 0.55);
}

.embed-shell-crazy-plane-landing:fullscreen .embed-frame,
.embed-shell-crazy-plane-landing:-webkit-full-screen .embed-frame {
  width: min(1366px, 100vw);
  height: min(768px, 100vh);
}

.embed-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.embed-toolbar .btn {
  padding: 8px 14px;
}

.score-panel {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.pacman-hud {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.chess-area {
  display: grid;
  gap: 14px;
  width: 100%;
}

.chess-board {
  position: relative;
  width: min(520px, 100%);
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.chess-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  width: 100%;
  height: 100%;
}

.chess-square {
  display: grid;
  place-items: center;
}

.chess-square.dark {
  background: rgba(10, 15, 33, 0.9);
}

.chess-square.light {
  background: rgba(255, 255, 255, 0.08);
}

.chess-square.legal {
  box-shadow: inset 0 0 0 3px rgba(109, 213, 255, 0.7);
}

.chess-square.attack {
  box-shadow: inset 0 0 0 3px rgba(255, 95, 122, 0.8);
}

.chess-piece {
  position: absolute;
  width: 12.5%;
  height: 12.5%;
  display: grid;
  place-items: center;
  font-size: clamp(24px, 4vw, 42px);
  transition: transform 0.25s ease;
  cursor: pointer;
  user-select: none;
}

.chess-piece.white {
  color: #f4f6ff;
  text-shadow: 0 6px 12px rgba(0, 0, 0, 0.35);
}

.chess-piece.black {
  color: #ffcf9b;
  text-shadow: 0 6px 12px rgba(0, 0, 0, 0.35);
}

.chess-trays {
  display: flex;
  gap: 10px;
}

.chess-tray {
  flex: 1;
  min-height: 70px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.05);
}

.chess-tray .chess-piece {
  position: static;
  width: 28px;
  height: 28px;
  font-size: 22px;
  transition: none;
}

.feedback-footer {
  margin-top: 24px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.feedback-footer a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.feedback-footer a:hover {
  color: var(--text);
  text-decoration: underline;
}

.game-vote-panel {
  margin: 0 0 18px;
  padding: 16px 18px;
  display: grid;
  gap: 10px;
}

.game-vote-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.game-vote-head h3 {
  margin: 8px 0 0;
  font-family: var(--font-head);
  font-size: 30px;
  letter-spacing: 1px;
  line-height: 1;
}

.game-vote-timer {
  font-family: var(--font-head);
  font-size: 28px;
  letter-spacing: 1px;
  line-height: 1;
  white-space: nowrap;
}

.game-vote-top {
  display: grid;
  gap: 8px;
}

.game-vote-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 14px;
}

.game-vote-item strong {
  font-family: var(--font-head);
  font-size: 24px;
  letter-spacing: 0.8px;
  line-height: 1;
}

.daily-quest-panel,
.tournament-panel {
  margin: 0 0 18px;
  padding: 16px 18px;
  display: grid;
  gap: 10px;
}

.daily-quest-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.daily-quest-head strong {
  font-family: var(--font-head);
  font-size: 24px;
  letter-spacing: 0.8px;
  line-height: 1;
}

.daily-quest-grid,
.tournament-top {
  display: grid;
  gap: 8px;
}

.tournament-time {
  font-family: var(--font-head);
  font-size: 28px;
  letter-spacing: 1px;
  line-height: 1;
  white-space: nowrap;
}

.tournament-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 14px;
}

.tournament-item strong {
  font-family: var(--font-head);
  font-size: 24px;
  letter-spacing: 0.8px;
  line-height: 1;
}

.big-update-panel {
  margin-top: 22px;
  padding: 16px 18px;
  display: grid;
  gap: 10px;
}

.big-update-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.big-update-head strong {
  font-size: 15px;
}

.big-update-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.update-countdown {
  margin-top: 22px;
  padding: 18px;
  display: grid;
  gap: 10px;
}

.update-countdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.update-countdown-title {
  margin-top: 8px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.update-countdown-time {
  font-family: var(--font-head);
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: 1px;
  line-height: 1;
}

.update-popup-overlay {
  z-index: 45;
}

.update-popup {
  width: min(520px, 92vw);
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  text-align: center;
}

.update-popup h2 {
  margin: 0;
  font-family: var(--font-head);
  font-size: clamp(32px, 6vw, 52px);
  letter-spacing: 1px;
  line-height: 1;
}

.update-popup-countdown {
  font-family: var(--font-head);
  font-size: clamp(28px, 5vw, 46px);
  letter-spacing: 1px;
  line-height: 1;
}

body.update-last-ten .app {
  animation: countdown-breathe 2.6s ease-in-out infinite;
}

body.update-last-five .app {
  animation-duration: 1.5s;
}

body.update-final-minute .app {
  animation-duration: 0.95s;
}

body.update-last-ten::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 57;
  background: linear-gradient(
      120deg,
      rgba(109, 213, 255, 0.07),
      rgba(139, 92, 255, 0.08),
      rgba(255, 95, 122, 0.06),
      rgba(109, 213, 255, 0.07)
    ),
    radial-gradient(circle at 18% 16%, rgba(109, 213, 255, 0.18), transparent 40%),
    radial-gradient(circle at 82% 84%, rgba(255, 95, 122, 0.14), transparent 46%);
  background-size: 220% 220%, auto, auto;
  opacity: 0.45;
  animation: countdown-drift 5.4s linear infinite;
}

body.update-last-five::before {
  opacity: 0.7;
  animation-duration: 3.8s;
}

body.update-final-minute::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 58;
  background: radial-gradient(circle at 50% 30%, rgba(255, 95, 122, 0.08), transparent 50%),
    radial-gradient(circle at 20% 80%, rgba(109, 213, 255, 0.08), transparent 45%);
  animation: final-minute-pulse 1.1s ease-in-out infinite;
}

.update-fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
}

.update-corner-timer {
  position: fixed;
  top: 14px;
  right: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(145deg, rgba(255, 95, 122, 0.9), rgba(139, 92, 255, 0.88));
  color: #fff;
  padding: 10px 14px;
  box-shadow: 0 12px 28px rgba(3, 7, 20, 0.52);
  opacity: 0;
  transform: translateY(-14px) scale(0.96);
  transition: opacity 0.2s ease, transform 0.2s ease;
  min-width: 188px;
  display: grid;
  gap: 4px;
}

.update-corner-label {
  font-size: 11px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  opacity: 0.9;
}

.update-corner-value {
  font-family: var(--font-head);
  font-size: 34px;
  letter-spacing: 1.2px;
  line-height: 0.95;
}

.update-corner-progress {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  overflow: hidden;
}

.update-corner-progress span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffffff, #ffe28a, #ffb347);
  box-shadow: 0 0 12px rgba(255, 226, 138, 0.5);
  transition: width 0.45s linear;
}

.update-corner-timer.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: corner-timer-pulse 0.95s ease-in-out infinite;
}

body.update-last-five .update-corner-timer.show {
  animation-duration: 0.68s;
}

body.update-last-five .update-corner-progress span {
  animation: corner-progress-glow 0.9s ease-in-out infinite;
}

.update-center-countdown {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  font-size: clamp(140px, 28vw, 260px);
  letter-spacing: 3px;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 22px 40px rgba(8, 12, 26, 0.7), 0 0 36px rgba(109, 213, 255, 0.55);
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.update-center-countdown.show {
  opacity: 1;
  transform: scale(1);
}

.update-center-countdown.pulse {
  animation: center-count-pulse 0.34s ease-out;
}

.update-launch-overlay {
  position: fixed;
  inset: 0;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.update-launch-overlay.active {
  opacity: 1;
  transform: scale(1);
}

.update-launch-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.update-burst-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  opacity: 0.95;
  animation: burst-fly 1s ease-out forwards;
}

.update-burst-ring {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.82);
  transform: translate(-50%, -50%);
  opacity: 0.8;
  animation: burst-ring 0.85s ease-out forwards;
}

.update-confetti {
  position: absolute;
  border-radius: 2px;
  opacity: 0.95;
  animation: confetti-drop linear forwards;
}

.update-release-panel {
  position: absolute;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%);
  width: min(760px, 92vw);
  padding: 18px;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(109, 213, 255, 0.45);
  background: linear-gradient(145deg, rgba(12, 18, 38, 0.92), rgba(22, 28, 52, 0.9));
  box-shadow: 0 28px 54px rgba(2, 6, 19, 0.62);
}

.update-release-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.update-release-head strong {
  font-size: 16px;
}

.update-release-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.update-release-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  padding: 10px 12px;
  color: var(--text);
  opacity: 0;
  transform: translateY(10px) scale(0.98);
}

.update-release-item.show {
  animation: update-reveal-in 0.34s ease-out forwards;
}

.update-release-item.boom {
  animation: update-reveal-boom 0.52s ease-out;
}

@keyframes countdown-breathe {
  0%,
  100% {
    filter: saturate(1) brightness(1);
    transform: translateY(0);
  }
  50% {
    filter: saturate(1.15) brightness(1.02);
    transform: translateY(-2px);
  }
}

@keyframes countdown-drift {
  0% {
    background-position: 0% 50%, center, center;
  }
  100% {
    background-position: 220% 50%, center, center;
  }
}

@keyframes final-minute-pulse {
  0%,
  100% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
}

@keyframes corner-timer-pulse {
  0%,
  100% {
    box-shadow: 0 12px 28px rgba(3, 7, 20, 0.52);
    transform: translateY(0) scale(1);
  }
  50% {
    box-shadow: 0 14px 30px rgba(255, 95, 122, 0.44);
    transform: translateY(-1px) scale(1.01);
  }
}

@keyframes corner-progress-glow {
  0%,
  100% {
    filter: brightness(1);
    box-shadow: 0 0 12px rgba(255, 226, 138, 0.5);
  }
  50% {
    filter: brightness(1.18);
    box-shadow: 0 0 16px rgba(255, 226, 138, 0.72);
  }
}

@keyframes center-count-pulse {
  0% {
    transform: scale(0.76);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.05);
    opacity: 1;
  }
}

@keyframes burst-fly {
  0% {
    transform: translate(-50%, -50%) scale(0.7);
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.05);
    opacity: 0;
  }
}

@keyframes burst-ring {
  0% {
    width: 12px;
    height: 12px;
    opacity: 0.86;
  }
  100% {
    width: var(--ring-size);
    height: var(--ring-size);
    opacity: 0;
  }
}

@keyframes confetti-drop {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--drift), 125vh, 0) rotate(560deg);
    opacity: 0.14;
  }
}

@keyframes update-reveal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes update-reveal-boom {
  0% {
    box-shadow: 0 0 0 rgba(255, 179, 71, 0);
  }
  35% {
    box-shadow: 0 0 28px rgba(255, 179, 71, 0.56), 0 0 48px rgba(109, 213, 255, 0.46);
  }
  100% {
    box-shadow: 0 0 0 rgba(255, 179, 71, 0);
  }
}

.terms-overlay {
  z-index: 55;
}

.terms-modal {
  width: min(620px, 92vw);
  max-height: 94vh;
  padding: 22px;
  display: grid;
  gap: 12px;
}

.terms-modal h2 {
  margin: 0;
  font-family: var(--font-head);
  letter-spacing: 1px;
}

.terms-last-updated {
  color: var(--muted);
  font-size: 13px;
}

.terms-text {
  min-height: 48vh;
  max-height: 68vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

@media (max-width: 720px) {
  .terms-modal {
    width: min(540px, 94vw);
    padding: 16px;
  }

  .terms-text {
    min-height: 54vh;
    max-height: 72vh;
  }
}

.terms-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  .layout-split,
  .game-layout,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .stage-header {
    flex-direction: column;
  }

  .stage-actions {
    justify-items: start;
  }

  .game-vote-head {
    flex-direction: column;
  }

  .daily-quest-head {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .game-vote-timer {
    font-size: 24px;
  }

  .tournament-time {
    font-size: 24px;
  }

  .update-release-panel {
    width: min(760px, 94vw);
    bottom: 26px;
  }

  .rps-online-players {
    grid-template-columns: 1fr;
  }

  .rps-online-vs {
    text-align: center;
  }
}

@media (max-width: 640px) {
  .user-chip {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-right {
    flex-wrap: wrap;
  }

  .game-vote-head h3 {
    font-size: 24px;
  }

  .game-vote-item strong {
    font-size: 20px;
  }

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

  .update-corner-timer {
    top: 10px;
    right: 10px;
    padding: 8px 11px;
    min-width: 158px;
  }

  .update-corner-value {
    font-size: 28px;
  }

  .update-release-panel {
    padding: 14px;
    width: min(760px, 95vw);
  }

  .game-chat-form {
    flex-direction: column;
  }

  .embed-fs-announcement {
    top: 8px;
    width: calc(100vw - 16px);
    padding: 8px 10px;
  }

  .embed-fs-chat {
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
    max-height: 44vh;
    padding: 8px 10px;
  }

  .embed-fs-title {
    font-size: 18px;
  }

  .memory-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .connect4-board {
    gap: 6px;
  }

  .rps-online-hands {
    grid-template-columns: 1fr;
  }
}
