* {
  box-sizing: border-box;
}

html,
body {
  overscroll-behavior-y: none;
}

:root {
  --primary: #dc2626;
  --primary-dark: #b91c1c;
  --primary-soft: #fee2e2;
  --accent: #f59e0b;
  --accent-soft: #fef3c7;
  --warning: #f59e0b;
  --danger: #dc2626;
  --bg: #fff5f5;
  --card: #ffffff;
  --border: #f3d5d5;
  --text: #1f2937;
  --muted: #7f1d1d;
  --shadow: none;
  --panel-height: 720px;
  --slip-width: 33vw;
  --slip-gap: 28px;
  --page-gutter: 24px;
  --ball-size: clamp(30px, 7.2vw, 44px);
  --ball-gap: clamp(4px, 1.2vw, 6px);
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  touch-action: manipulation;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 30px;
  background: linear-gradient(120deg, #dc2626 0%, #ef4444 45%, #f97316 100%);
  color: #fff;
  border-bottom: none;
  position: relative;
  overflow: visible;
  z-index: 50;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.22), transparent 45%),
    radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.18), transparent 50%);
  pointer-events: none;
}

.topbar > * {
  position: relative;
  z-index: 1;
}

.topbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.brand h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0.5px;
}

.brand p {
  margin: 4px 0 0;
  font-size: 13px;
  opacity: 0.85;
}

.account {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(8px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-menu {
  position: relative;
}

.user-menu-toggle {
  padding: 6px 10px;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  display: flex;
  flex-direction: column;
  min-width: 160px;
  max-width: calc(100vw - 32px);
  box-sizing: border-box;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #f3b4b4;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
  padding: 6px;
  z-index: 2100;
}

.user-dropdown.hidden {
  display: none;
}

.user-dropdown button,
.user-dropdown a {
  display: flex;
  align-items: center;
  width: 100%;
  border: none;
  background: transparent;
  color: #7f1d1d;
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 8px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.user-dropdown button:hover,
.user-dropdown a:hover {
  background: #fee2e2;
}

.user-dropdown .menu-divider {
  height: 1px;
  background: #f3b4b4;
  margin: 4px 6px;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.user-info .points {
  background: rgba(255, 255, 255, 0.22);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 14px;
}

button {
  cursor: pointer;
  border: none;
  background: var(--primary);
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s ease;
}

button:hover {
  background: var(--primary-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

button.primary:disabled {
  background: #d1d5db;
  color: #6b7280;
}

button.outline:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  border-color: #e5e7eb;
}

button.outline {
  background: #fff;
  border: 1px solid var(--primary);
  color: var(--primary);
}

button.outline:hover {
  background: var(--primary-soft);
}

button.ghost {
  background: transparent;
  border: 1px solid transparent;
  color: #6b7280;
  box-shadow: none;
}

button.ghost:hover {
  background: #f9fafb;
  color: #374151;
}

.topbar button.outline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff;
}

.login-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  color: #fff;
  background: transparent;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
}

button.primary {
  width: 100%;
  padding: 12px;
  font-size: 15px;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 20px var(--page-gutter);
  max-width: 1280px;
  margin: 0 auto;
}

.layout-primary {
  grid-template-columns: 1fr;
  padding-bottom: 6px;
}

.layout-secondary {
  padding-top: 0;
  padding-bottom: 40px;
  margin: 6px auto 0;
}

.panel {
  background: var(--card);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 1px dashed #f3b4b4;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.panel-header h2 {
  margin: 0;
  font-size: 18px;
  color: #b91c1c;
  letter-spacing: 0.4px;
}

.panel h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: #b91c1c;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.section-header h3 {
  margin: 0;
}

.view-more {
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  color: #dc2626;
  background: #ffe2e2;
  border: 1px solid #f3b4b4;
  padding: 4px 10px;
  border-radius: 999px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.view-more:hover {
  background: #fee2e2;
  border-color: #ef4444;
}
.game-tag {
  font-size: 12px;
  margin-left: 6px;
  color: #ef4444;
  font-weight: 600;
}

.bet-panel,
.slip-panel {
  border: 1px solid #f3b4b4;
}

.bet-panel {
  height: auto;
  max-height: none;
  overflow: visible;
}

.slip-panel {
  height: var(--panel-height);
  max-height: calc(100vh - 180px);
}

.info-panel {
  border: 1px solid #f7c9c9;
}

.latest-panel {
  border: 1px dashed #f3b4b4;
}

.slip-panel {
  overflow: hidden;
}

.panel-section {
  padding-bottom: 12px;
  border-bottom: 1px dashed #f2b5b5;
}

.panel-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.issue-status {
  font-size: 13px;
  color: #7f1d1d;
  background: #fee2e2;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #f3b4b4;
}

.game-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.45);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  color: #fff;
  min-width: 200px;
  white-space: nowrap;
  flex-wrap: nowrap;
  max-width: 100%;
  min-height: 40px;
}

.game-switch select {
  border: none;
  background: transparent;
  font-weight: 700;
  color: #fff;
  min-width: 170px;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.game-switch span {
  white-space: nowrap;
}

.game-switch select:focus {
  outline: none;
}

.game-switch select option {
  color: #1f2937;
}

.tabs {
  display: flex;
  gap: 8px;
  background: #fee2e2;
  padding: 6px;
  border-radius: 999px;
}

.tab {
  background: transparent;
  color: #7f1d1d;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 18px;
}

.tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.tab:hover {
  color: #fff;
}

.selected-box {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 16px;
  font-weight: 700;
  background: #ffe3e3;
  border: 2px solid #f2a3a3;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 12px;
  box-shadow: 0 10px 18px rgba(185, 28, 28, 0.12), 0 4px 8px rgba(15, 23, 42, 0.08);
}

.selected-numbers {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.selected-numbers span {
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.78) 0 16%, rgba(255, 255, 255, 0.4) 24%, rgba(255, 255, 255, 0.12) 34%, rgba(255, 255, 255, 0) 46%),
    radial-gradient(circle at 70% 78%, rgba(0, 0, 0, 0.28) 0 32%, rgba(0, 0, 0, 0.16) 44%, rgba(0, 0, 0, 0) 62%),
    radial-gradient(circle at 50% 50%, #fee2e2 0%, #fcb4b4 30%, #f87171 50%, #ef4444 68%, #c02626 84%, #7f1d1d 100%);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  padding: 0;
  border-radius: 999px;
  font-size: clamp(12px, calc(var(--ball-size) * 0.38), 17px);
  width: var(--ball-size);
  height: var(--ball-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  font-weight: 800;
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.65),
    inset 0 -5px 10px rgba(0, 0, 0, 0.16),
    0 6px 10px rgba(15, 23, 42, 0.22);
  filter: saturate(1.08) brightness(1.06);
}

.selected-count {
  color: #991b1b;
}

.number-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--ball-size), 1fr));
  gap: var(--ball-gap);
  align-items: start;
}

@media (min-width: 1024px) {
  .number-grid {
    grid-template-columns: repeat(15, minmax(var(--ball-size), 1fr));
  }
}

.number-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.zodiac-label {
  font-size: 12px;
  color: #9f1239;
  line-height: 1;
  text-align: center;
}

.zodiac-module {
  background: #fff7f7;
  border: 1px dashed #f3b4b4;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.zodiac-header {
  font-size: 14px;
  font-weight: 700;
  color: #b91c1c;
}

.zodiac-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.zodiac-btn {
  background: #fff;
  border: 1px solid #f3b4b4;
  color: #b91c1c;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 700;
  min-height: 34px;
}

.zodiac-btn.active,
.zodiac-btn:hover:not(:disabled) {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.zodiac-btn:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  border-color: #e5e7eb;
  cursor: not-allowed;
}

.zodiac-numbers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  gap: 8px;
}

.zodiac-numbers .number-btn {
  height: var(--ball-size);
  font-size: clamp(12px, calc(var(--ball-size) * 0.38), 17px);
}

.number-btn {
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.78) 0 16%, rgba(255, 255, 255, 0.4) 24%, rgba(255, 255, 255, 0.12) 34%, rgba(255, 255, 255, 0) 46%),
    radial-gradient(circle at 70% 78%, rgba(0, 0, 0, 0.28) 0 32%, rgba(0, 0, 0, 0.16) 44%, rgba(0, 0, 0, 0) 62%),
    radial-gradient(circle at 50% 50%, #fee2e2 0%, #fcb4b4 30%, #f87171 50%, #ef4444 68%, #c02626 84%, #7f1d1d 100%);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 999px;
  padding: 0;
  height: var(--ball-size);
  font-weight: 800;
  font-size: clamp(12px, calc(var(--ball-size) * 0.38), 17px);
  transition: all 0.2s ease;
  aspect-ratio: 1 / 1;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.65),
    inset 0 -5px 10px rgba(0, 0, 0, 0.16),
    0 6px 10px rgba(15, 23, 42, 0.22);
  filter: saturate(1.08);
}

.number-btn.selected {
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.7) 0 14%, rgba(255, 255, 255, 0.38) 22%, rgba(255, 255, 255, 0.12) 34%, rgba(255, 255, 255, 0) 46%),
    radial-gradient(circle at 70% 78%, rgba(0, 0, 0, 0.32) 0 34%, rgba(0, 0, 0, 0.2) 46%, rgba(0, 0, 0, 0) 64%),
    radial-gradient(circle at 50% 50%, #fcb4b4 0%, #f87171 38%, #ef4444 64%, #c02626 84%, #7f1d1d 100%);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  border: 2px solid #ef4444;
  box-shadow:
    0 0 0 2px #ef4444,
    inset 0 2px 6px rgba(255, 255, 255, 0.35),
    inset 0 -5px 10px rgba(0, 0, 0, 0.2),
    0 10px 16px rgba(15, 23, 42, 0.3);
  filter: saturate(1.02) brightness(1.06);
}

.bet-panel.tm-mode .number-btn:not(.wave-ball) {
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.74) 0 16%, rgba(255, 255, 255, 0.36) 24%, rgba(255, 255, 255, 0.1) 34%, rgba(255, 255, 255, 0) 46%),
    radial-gradient(circle at 70% 78%, rgba(0, 0, 0, 0.28) 0 32%, rgba(0, 0, 0, 0.16) 44%, rgba(0, 0, 0, 0) 62%),
    radial-gradient(circle at 50% 50%, #fff6d4 0%, #fde68a 32%, #fbbf24 58%, #f59e0b 76%, #d97706 88%, #92400e 100%);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  font-weight: 800;
  font-size: clamp(12px, calc(var(--ball-size) * 0.38), 17px);
  -webkit-text-stroke: 0;
  border: none;
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.55),
    inset 0 -5px 10px rgba(0, 0, 0, 0.18),
    0 6px 10px rgba(15, 23, 42, 0.22);
  filter: saturate(1.08);
}

.bet-panel.tm-mode .number-btn.selected:not(.wave-ball) {
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.68) 0 14%, rgba(255, 255, 255, 0.32) 22%, rgba(255, 255, 255, 0.1) 34%, rgba(255, 255, 255, 0) 46%),
    radial-gradient(circle at 70% 78%, rgba(0, 0, 0, 0.3) 0 34%, rgba(0, 0, 0, 0.18) 46%, rgba(0, 0, 0, 0) 64%),
    radial-gradient(circle at 50% 50%, #fde68a 0%, #fbbf24 52%, #f59e0b 72%, #d97706 86%, #92400e 100%);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  border: 2px solid #f59e0b;
  box-shadow:
    0 0 0 2px #f59e0b,
    inset 0 2px 6px rgba(255, 255, 255, 0.35),
    inset 0 -5px 10px rgba(0, 0, 0, 0.2),
    0 10px 16px rgba(15, 23, 42, 0.3);
  filter: saturate(1.08) brightness(1.12);
}

.bet-panel.tm-mode .selected-numbers span:not(.wave-ball) {
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.74) 0 16%, rgba(255, 255, 255, 0.36) 24%, rgba(255, 255, 255, 0.1) 34%, rgba(255, 255, 255, 0) 46%),
    radial-gradient(circle at 70% 78%, rgba(0, 0, 0, 0.28) 0 32%, rgba(0, 0, 0, 0.16) 44%, rgba(0, 0, 0, 0) 62%),
    radial-gradient(circle at 50% 50%, #fff6d4 0%, #fde68a 32%, #fbbf24 58%, #f59e0b 76%, #d97706 88%, #92400e 100%);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  font-weight: 800;
  font-size: clamp(12px, calc(var(--ball-size) * 0.38), 17px);
  -webkit-text-stroke: 0;
  border-color: transparent;
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.55),
    inset 0 -5px 10px rgba(0, 0, 0, 0.18),
    0 6px 10px rgba(15, 23, 42, 0.22);
  filter: saturate(1.08) brightness(1.06);
}

.number-btn.wave-ball,
.number-btn.wave-ball.selected,
.bet-panel.tm-mode .number-btn.wave-ball,
.bet-panel.tm-mode .number-btn.wave-ball.selected {
  background: var(--wave-bg);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  border: none;
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.6),
    inset 0 -5px 10px rgba(0, 0, 0, 0.16),
    0 6px 10px rgba(15, 23, 42, 0.22);
  filter: saturate(1.08);
}

.number-btn.wave-ball.selected {
  box-shadow:
    0 0 0 2px var(--wave-color),
    inset 0 2px 6px rgba(255, 255, 255, 0.6),
    inset 0 -5px 10px rgba(0, 0, 0, 0.16),
    0 10px 16px rgba(15, 23, 42, 0.3);
  border: 2px solid var(--wave-color);
}

.bet-panel.tm-mode .number-btn.wave-ball.selected {
  box-shadow:
    0 0 0 2px var(--wave-color),
    inset 0 2px 6px rgba(255, 255, 255, 0.6),
    inset 0 -5px 10px rgba(0, 0, 0, 0.16),
    0 10px 16px rgba(15, 23, 42, 0.3);
  filter: saturate(1.08) brightness(1.12);
}

.bet-panel:not(.tm-mode) .number-btn.selected {
  border-width: 1px;
  box-shadow:
    0 0 0 1px #ef4444,
    inset 0 2px 6px rgba(255, 255, 255, 0.35),
    inset 0 -5px 10px rgba(0, 0, 0, 0.2),
    0 10px 16px rgba(15, 23, 42, 0.3);
}

.bet-panel:not(.tm-mode) .number-btn.wave-ball.selected {
  border-width: 1px;
  border-color: var(--wave-color);
  box-shadow:
    0 0 0 1px var(--wave-color),
    inset 0 2px 6px rgba(255, 255, 255, 0.6),
    inset 0 -5px 10px rgba(0, 0, 0, 0.16),
    0 10px 16px rgba(15, 23, 42, 0.3);
}

.selected-numbers span.wave-ball {
  background: var(--wave-bg);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  border: none;
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.6),
    inset 0 -5px 10px rgba(0, 0, 0, 0.16),
    0 6px 10px rgba(15, 23, 42, 0.22);
  filter: saturate(1.08);
}

.number-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.bet-inputs {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  background: #fff7f7;
  border: 1px solid #f3b4b4;
  padding: 10px;
  border-radius: 12px;
}

.bet-inputs input {
  width: 120px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid var(--border);
  padding: 0 8px;
  background: #fff;
}

.bet-inputs label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #991b1b;
}

.tips {
  font-size: 13px;
  color: #991b1b;
}

.tips.small {
  font-size: 12px;
}

.tips.bold-tip {
  font-weight: 700;
}

.info-panel .panel-section h3 {
  margin: 0 0 8px;
  color: #b91c1c;
}

.draw-card {
  background: #fff7f7;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid #f3b4b4;
  border-style: dashed;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.news-item {
  text-decoration: none;
  color: var(--text);
  background: #fff7f7;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed #f3b4b4;
  border-left: 3px solid #dc2626;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.news-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(220, 38, 38, 0.12);
}

.news-title {
  font-size: 14px;
  font-weight: 700;
  color: #b91c1c;
}

.news-title-prefix {
  font-weight: 400;
}

.news-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #9f1239;
}

.news-summary {
  margin-top: 6px;
  font-size: 12px;
  color: #7f1d1d;
  line-height: 1.4;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.page-btn {
  background: #fff7f7;
  color: #dc2626;
  border: 1px solid #f3b4b4;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.page-btn:hover:not(:disabled) {
  background: #fee2e2;
  border-color: #ef4444;
}

.page-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.page-btn.active {
  background: #fee2e2;
  border-color: #ef4444;
  color: #b91c1c;
}

.page-ellipsis {
  font-size: 12px;
  color: #9f1239;
  padding: 0 4px;
}

.news-item .news-summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-cover {
  flex: 0 0 90px;
  height: 70px;
}

.news-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.news-info {
  flex: 1;
  min-width: 0;
}

.news-empty {
  font-size: 13px;
  color: #9f1239;
  background: #fff7f7;
  border: 1px dashed #f3b4b4;
  border-radius: 12px;
  padding: 12px;
}

.numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.ball-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.ball-zodiac {
  font-size: 12px;
  line-height: 1;
  color: #9f1239;
  min-height: 12px;
}

#draw-history-list .numbers {
  flex-wrap: nowrap;
  gap: 4px;
  align-items: flex-start;
}

#draw-history-list .ball {
  width: clamp(32px, 10vw, 40px);
  height: clamp(32px, 10vw, 40px);
  font-size: clamp(14px, 4vw, 18px);
}

#bet-history .numbers,
#draw-history .numbers {
  gap: 4px;
}

#draw-history .numbers {
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: flex-start;
}

#bet-history .ball,
#draw-history .ball {
  width: clamp(32px, 9.5vw, 38px);
  height: clamp(32px, 9.5vw, 38px);
  font-size: clamp(14px, 3.6vw, 17px);
}

#current-bet-info .ball {
  width: clamp(32px, 9.5vw, 38px);
  height: clamp(32px, 9.5vw, 38px);
  font-size: clamp(14px, 3.6vw, 17px);
}

#bet-history-list .ball {
  width: clamp(32px, 9.5vw, 38px);
  height: clamp(32px, 9.5vw, 38px);
  font-size: clamp(14px, 3.6vw, 17px);
}

#draw-history-list .draw-meta {
  font-size: 15px;
}

.ball {
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.78) 0 16%, rgba(255, 255, 255, 0.4) 24%, rgba(255, 255, 255, 0.12) 34%, rgba(255, 255, 255, 0) 46%),
    radial-gradient(circle at 70% 78%, rgba(0, 0, 0, 0.28) 0 32%, rgba(0, 0, 0, 0.16) 44%, rgba(0, 0, 0, 0) 62%),
    radial-gradient(circle at 50% 50%, #fee2e2 0%, #fcb4b4 30%, #f87171 50%, #ef4444 68%, #c02626 84%, #7f1d1d 100%);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  border: none;
  font-variant-numeric: tabular-nums;
  width: 30px;
  height: 30px;
  aspect-ratio: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.65),
    inset 0 -5px 10px rgba(0, 0, 0, 0.16),
    0 6px 10px rgba(15, 23, 42, 0.22);
  filter: saturate(1.08);
}

.wave-ball {
  --wave-color: #16a34a;
  --wave-color-soft: rgba(22, 163, 74, 0.82);
  --wave-color-mid: rgba(22, 163, 74, 0.58);
  --wave-color-light: rgba(22, 163, 74, 0.28);
  --wave-bg:
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.78) 0 16%, rgba(255, 255, 255, 0.4) 26%, rgba(255, 255, 255, 0.12) 38%, rgba(255, 255, 255, 0) 50%),
    radial-gradient(circle at 70% 78%, rgba(0, 0, 0, 0.26) 0 34%, rgba(0, 0, 0, 0.16) 48%, rgba(0, 0, 0, 0) 66%),
    radial-gradient(circle at 52% 88%, var(--wave-color-soft) 0 24%, var(--wave-color-mid) 40%, var(--wave-color-light) 62%, transparent 82%),
    radial-gradient(circle at 18% 56%, var(--wave-color-soft) 0 22%, var(--wave-color-mid) 40%, var(--wave-color-light) 62%, transparent 84%),
    radial-gradient(circle at 84% 54%, var(--wave-color-soft) 0 22%, var(--wave-color-mid) 40%, var(--wave-color-light) 62%, transparent 84%),
    radial-gradient(circle at 50% 8%, var(--wave-color-soft) 0 18%, var(--wave-color-mid) 34%, var(--wave-color-light) 56%, transparent 78%),
    radial-gradient(circle at 50% 50%, #f9fafb 0%, #eef2f7 62%, #e2e8f0 100%);
  background: var(--wave-bg);
  border-radius: 50%;
  border: none;
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.6),
    inset 0 -5px 10px rgba(0, 0, 0, 0.16),
    0 6px 10px rgba(15, 23, 42, 0.22);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  filter: saturate(1.08);
}

.wave-red {
  --wave-color: #dc2626;
  --wave-color-soft: rgba(220, 38, 38, 0.82);
  --wave-color-mid: rgba(220, 38, 38, 0.58);
  --wave-color-light: rgba(220, 38, 38, 0.28);
}

.wave-blue {
  --wave-color: #2563eb;
  --wave-color-soft: rgba(37, 99, 235, 0.82);
  --wave-color-mid: rgba(37, 99, 235, 0.58);
  --wave-color-light: rgba(37, 99, 235, 0.28);
}

.wave-green {
  --wave-color: #16a34a;
  --wave-color-soft: rgba(22, 163, 74, 0.82);
  --wave-color-mid: rgba(22, 163, 74, 0.58);
  --wave-color-light: rgba(22, 163, 74, 0.28);
}

.ball.wave-ball {
  border-color: transparent;
}

.ball.tm {
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.74) 0 16%, rgba(255, 255, 255, 0.36) 24%, rgba(255, 255, 255, 0.1) 34%, rgba(255, 255, 255, 0) 46%),
    radial-gradient(circle at 70% 78%, rgba(0, 0, 0, 0.28) 0 32%, rgba(0, 0, 0, 0.16) 44%, rgba(0, 0, 0, 0) 62%),
    radial-gradient(circle at 50% 50%, #fff6d4 0%, #fde68a 32%, #fbbf24 58%, #f59e0b 76%, #d97706 88%, #92400e 100%);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  border-color: transparent;
  border-radius: 50%;
  filter: saturate(1.08);
}

.number-btn:hover:not(:disabled) {
  background:
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.82) 0 18%, rgba(255, 255, 255, 0.45) 26%, rgba(255, 255, 255, 0.14) 36%, rgba(255, 255, 255, 0) 48%),
    radial-gradient(circle at 70% 78%, rgba(0, 0, 0, 0.25) 0 32%, rgba(0, 0, 0, 0.14) 44%, rgba(0, 0, 0, 0) 62%),
    radial-gradient(circle at 50% 50%, #fee2e2 0%, #fcb4b4 28%, #f87171 50%, #ef4444 68%, #c02626 84%, #7f1d1d 100%);
}

.bet-panel.tm-mode .number-btn:hover:not(:disabled):not(.wave-ball) {
  background:
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.8) 0 18%, rgba(255, 255, 255, 0.4) 26%, rgba(255, 255, 255, 0.12) 36%, rgba(255, 255, 255, 0) 48%),
    radial-gradient(circle at 70% 78%, rgba(0, 0, 0, 0.24) 0 32%, rgba(0, 0, 0, 0.14) 44%, rgba(0, 0, 0, 0) 62%),
    radial-gradient(circle at 50% 50%, #fff6d4 0%, #fde68a 30%, #fbbf24 56%, #f59e0b 74%, #d97706 86%, #92400e 100%);
}

.number-btn.wave-ball:hover:not(:disabled) {
  background: var(--wave-bg);
}

.bet-panel.tm-mode .zodiac-label {
  color: #7a4a0b;
}

.bet-info {
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: auto;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.bet-info .summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: #374151;
}

.bet-info .summary span {
  background: #fee2e2;
  padding: 4px 8px;
  border-radius: 999px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  max-height: 260px;
  overflow-y: auto;
}

.history-list.full {
  max-height: none;
  overflow: visible;
}

#section-bets .list-actions {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0 10px;
}

#bet-history.history-list {
  height: auto;
  max-height: 360px;
}

#draw-history.history-list {
  max-height: none;
  overflow: visible;
}

.stats-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stats-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 14px;
  color: #1f2937;
}

.stats-header h3 {
  margin: 0;
  font-size: 16px;
}

.stats-section-title {
  margin-top: 10px;
  margin-bottom: 6px;
  font-size: 13px;
  color: #7f1d1d;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}

.stats-zodiac-grid {
  margin-bottom: 4px;
}

.stats-item {
  background: #fff7f7;
  border: 1px dashed #f3b4b4;
  border-radius: 10px;
  padding: 8px;
  text-align: center;
  font-size: 12px;
}

.stats-number {
  font-weight: 700;
  color: #b91c1c;
  font-size: 13px;
}

.stats-amount {
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  color: #7f1d1d;
}

.stats-empty {
  font-size: 13px;
  color: #9f1239;
  background: #fff7f7;
  border: 1px dashed #f3b4b4;
  border-radius: 12px;
  padding: 12px;
}

.history-item {
  background: #fff7f7;
  padding: 8px 10px;
  border-radius: 10px;
  border-left: 3px solid #f3b4b4;
  border: 1px dashed #f3b4b4;
}

.agent-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #ef4444;
  border-radius: 999px;
}

.agent-header,
.agent-user-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.agent-title,
.agent-user-title,
.user-admin-title {
  font-weight: 600;
}

.agent-actions,
.user-admin-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.agent-meta,
.agent-user-meta,
.user-admin-meta {
  color: #6b7280;
  margin-top: 4px;
}

.agent-link-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.agent-link-input {
  flex: 1;
  min-width: 220px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 12px;
}

.readonly-input {
  background: #f3f4f6;
  color: #6b7280;
}

.empty-text {
  color: #9ca3af;
  font-size: 13px;
}

.history-item.has-win {
  background: #fff6df;
  border-color: #f5cf8a;
  border-left-color: #f2c46e;
}

.history-item.wallet-status-approved {
  background: #f0fdf4;
  border-color: #4ade80;
  border-left-color: #22c55e;
}

.history-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff7f7;
  border: 1px dashed #f3b4b4;
  border-radius: 12px;
  padding: 12px;
}

.history-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.history-group-title {
  font-weight: 700;
  color: #b91c1c;
}

.history-issue-time {
  margin-left: 8px;
  font-weight: 400;
  color: #6b7280;
}

.history-group-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pending-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.pending-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff7f7;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  border: 1px solid var(--border);
}

.pending-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
}

#pending-pm .pending-item {
  border-left: 3px solid #dc2626;
}

#pending-tm .pending-item {
  border-left: 3px solid #f59e0b;
}

.pending-item button {
  padding: 4px 10px;
  font-size: 12px;
}

.pending-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  background: #fee2e2;
  border: 1px solid #f3b4b4;
  padding: 8px 10px;
  border-radius: 12px;
}

.status-message {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translate(-50%, -16px);
  opacity: 0;
  pointer-events: none;
  background: var(--accent-soft);
  color: #92400e;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.15);
  transition: transform 0.25s ease, opacity 0.25s ease;
  z-index: 3000;
  max-width: min(520px, 90vw);
  text-align: center;
}

.status-message.toast-show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #fee2e2;
  color: #991b1b;
}

.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.status-confirmed {
  background: #fee2e2;
  color: #991b1b;
}

.status-draw {
  background: #ffe4e6;
  color: #be123c;
}

.status-settled {
  background: var(--accent-soft);
  color: #166534;
}

.status-canceled {
  background: #e5e7eb;
  color: #6b7280;
}

.bet-detail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.bet-detail-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.bet-detail-footer button {
  padding: 4px 10px;
  font-size: 12px;
}

.hidden {
  display: none !important;
}

.news-page {
  max-width: 960px;
  margin: 24px auto 60px;
  padding: 0 24px;
}

.news-page.wide {
  max-width: 1280px;
}

.news-card {
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.news-cover-large {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
}

.news-cover-large img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  display: block;
}

.news-card h2 {
  margin: 0;
  color: #b91c1c;
  font-size: 22px;
}

.news-card .news-summary {
  font-size: 14px;
  color: #7f1d1d;
  background: #fff7f7;
  border: 1px dashed #f3b4b4;
  border-radius: 12px;
  padding: 10px 12px;
}

.news-body {
  white-space: normal;
  font-size: 15px;
  color: #1f2937;
  line-height: 1.7;
}

.news-body p {
  margin: 0 0 12px;
}

.news-body h2,
.news-body h3 {
  margin: 16px 0 8px;
  color: #b91c1c;
}

.news-body ul,
.news-body ol {
  margin: 0 0 12px 20px;
  padding: 0;
}

.news-body blockquote {
  margin: 12px 0;
  padding: 10px 14px;
  background: #fff7f7;
  border-left: 4px solid #dc2626;
  border-radius: 10px;
  color: #7f1d1d;
}

.news-body img,
.news-body video {
  max-width: 100%;
  border-radius: 14px;
  display: block;
  margin: 12px 0;
}

.news-body video {
  width: 100%;
  background: #111827;
}

.news-body a {
  color: #dc2626;
  font-weight: 600;
}

.rules-content {
  min-height: 120px;
}

.rules-empty {
  font-size: 13px;
  color: #9f1239;
  background: #fff7f7;
  border: 1px dashed #f3b4b4;
  border-radius: 12px;
  padding: 12px;
}

.auth-page {
  background: var(--bg);
}

.auth-container {
  max-width: 520px;
  width: 100%;
  margin: 40px auto 80px;
  padding: 0 20px;
  box-sizing: border-box;
}

.auth-card h2 {
  margin: 0 0 12px;
  color: #b91c1c;
}

.monitor-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.monitor-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.monitor-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.monitor-status-item {
  background: #fff7f7;
  border: 1px dashed #f3b4b4;
  border-radius: 12px;
  padding: 12px;
}

.monitor-status-label {
  font-size: 12px;
  color: #7f1d1d;
  margin-bottom: 6px;
}

.monitor-status-value {
  font-weight: 700;
  color: #b91c1c;
}

.monitor-iframe {
  width: 100%;
  min-height: 520px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}

.wallet-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wallet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
}

.wallet-summary h3 {
  margin: 0 0 6px;
  color: #b91c1c;
}

.wallet-balance {
  font-size: 16px;
  color: #7f1d1d;
  margin: 0;
}

.wallet-balance strong {
  font-size: 24px;
  color: #dc2626;
}

.wallet-agent-info {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: #fff7f7;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wallet-agent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.wallet-agent-label {
  font-size: 13px;
  color: #7f1d1d;
  font-weight: 600;
}

.wallet-agent-link {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}

.wallet-agent-link .agent-link-input {
  flex: 1;
  min-width: 200px;
}

.wallet-agent-meta {
  font-size: 12px;
  color: #7f1d1d;
  gap: 16px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wallet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 44px;
}

.wallet-actions .view-more {
  margin-left: 0;
  position: absolute;
  top: 0;
  right: 0;
}

.wallet-qr-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: #fff7f7;
}

.wallet-qr-info h4 {
  margin: 0 0 6px;
  color: #b91c1c;
}

.wallet-qr-grid {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.wallet-qr-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.wallet-qr-label {
  font-size: 13px;
  color: #7f1d1d;
  font-weight: 600;
}

.wallet-records {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.wallet-agent-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.agent-invite-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.agent-invite-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.agent-invite-name {
  font-weight: 600;
  color: #b91c1c;
}

.agent-invite-meta,
.agent-invite-stats {
  font-size: 12px;
  color: #7f1d1d;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.agent-invite-stats strong {
  color: #b91c1c;
}

.agent-net-positive {
  color: #16a34a;
  font-weight: 600;
}

.agent-net-negative {
  color: #dc2626;
  font-weight: 600;
}

.modal-card.modal-large {
  max-width: 680px;
  width: calc(100% - 32px);
}

.wallet-history {
  max-height: 360px;
  overflow-y: auto;
}

.wallet-item-title {
  font-weight: 700;
  color: #b91c1c;
}

.wallet-item-meta {
  font-size: 12px;
  color: #7f1d1d;
  margin-top: 4px;
}

.qr-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 160px;
  min-height: 160px;
  padding: 10px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: #fff;
  text-align: center;
}

.qr-preview img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
}

.qr-preview p {
  margin: 0;
  font-size: 12px;
  color: #9f1239;
}

.form-hint {
  margin: 0;
  font-size: 12px;
  color: #9f1239;
}

#deposit-modal .modal-card {
  width: min(520px, 92vw);
}

#withdraw-modal .modal-card {
  width: min(520px, 92vw);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: #7f1d1d;
  min-width: 0;
}

.auth-form input {
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #f3b4b4;
  min-width: 0;
}

.captcha-row {
  display: grid;
  grid-template-columns: 1fr 110px auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.captcha-row input {
  min-width: 0;
  height: 40px;
}

.captcha-row img {
  width: 110px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid #f3b4b4;
  background: #fff7f7;
  cursor: pointer;
}

.auth-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.auth-actions button {
  flex: 1;
}

@media (max-width: 540px) {
  .auth-container {
    margin: 24px auto 60px;
    padding: 0 14px;
  }

  .captcha-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "input input"
      "image button";
  }

  .captcha-row input {
    grid-area: input;
  }

  .captcha-row img {
    grid-area: image;
    width: 110px;
  }

  .captcha-row button {
    grid-area: button;
  }

  .auth-actions {
    flex-direction: column;
  }
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.modal-card {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  min-width: 280px;
  max-width: 90vw;
  border: 1px solid #f3b4b4;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: #7f1d1d;
}

.modal-form input {
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #f3b4b4;
}

.modal-form select {
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #f3b4b4;
  background: #fff;
  color: inherit;
}

.modal-card h3 {
  margin: 0;
  font-size: 18px;
  color: #b91c1c;
}

.modal-card p {
  margin: 0;
  color: #7f1d1d;
  font-size: 14px;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.topbar .back-link {
  text-decoration: none;
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.18);
  font-weight: 600;
}

@media (min-width: 1025px) {
  :root {
    --page-gutter: 120px;
  }

  .layout-primary,
  .layout-secondary {
    max-width: none;
    padding-right: calc(var(--slip-width) + var(--slip-gap) + var(--page-gutter));
  }

  .layout-secondary {
    margin: 6px 0 0;
  }

  .slip-panel {
    position: fixed;
    top: 110px;
    right: var(--page-gutter);
    width: var(--slip-width);
    height: min(var(--panel-height), calc(100vh - 150px));
    max-height: calc(100vh - 150px);
    z-index: 5;
    border-left: 4px solid var(--primary);
  }
}

@media (max-width: 1024px) {
  .topbar {
    align-items: flex-start;
  }

  .topbar-left {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .topbar-left .brand {
    order: 0;
  }

  .topbar-left .game-switch {
    order: 1;
    width: 100%;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    position: static;
  }

  .topbar-actions .account {
    position: absolute;
    top: 16px;
    right: 20px;
  }

  .game-switch {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    align-self: flex-start;
    justify-content: space-between;
  }

  .game-switch select {
    width: 100%;
    min-width: 0;
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .number-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .bet-panel,
  .slip-panel {
    position: static;
    width: auto;
    height: auto;
    max-height: none;
  }

  .bet-inputs {
    flex-direction: column;
    align-items: stretch;
  }

  .bet-inputs input {
    width: 100%;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  :root {
    --ball-size: clamp(48px, 6.2vw, 60px);
    --ball-gap: clamp(6px, 1vw, 10px);
  }
}

@media (max-width: 640px) {
  :root {
    --ball-size: clamp(38px, 9.6vw, 44px);
    --ball-gap: clamp(4px, 1.2vw, 6px);
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand actions"
      "switch switch";
    align-items: center;
    column-gap: 12px;
    row-gap: 8px;
    padding: 14px 16px;
  }

  .topbar-left {
    display: contents;
  }

  .topbar-left .brand {
    grid-area: brand;
    min-width: 0;
  }

  .brand h1 {
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .brand p {
    display: none;
  }

  .topbar-left .game-switch {
    grid-area: switch;
    width: 100%;
  }

  .topbar-actions {
    grid-area: actions;
    width: auto;
    justify-content: flex-end;
    justify-self: end;
    align-self: center;
  }

  .topbar-actions .account {
    position: static;
    max-width: calc(100vw - 32px);
  }

  .user-info {
    flex-wrap: nowrap;
  }

  .user-meta {
    min-width: 0;
  }

  #user-name {
    display: inline-block;
    max-width: 22vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bet-panel .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .user-menu {
    position: static;
  }

  .user-dropdown {
    right: 16px;
    left: auto;
    transform: none;
    width: min(220px, calc(100vw - 32px));
    min-width: 160px;
    max-width: calc(100vw - 32px);
  }

  .bet-panel .panel-header h2 {
    width: 100%;
  }

  .bet-panel .panel-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .bet-panel .issue-status {
    width: 100%;
    text-align: left;
    border-radius: 12px;
  }

  input,
  textarea {
    font-size: 16px;
  }

  select {
    height: 44px;
    font-size: 16px;
    padding: 0 12px;
  }

  .news-page {
    max-width: none;
    padding: 16px 12px 40px;
  }

  .bet-info {
    max-height: none;
    overflow: visible;
  }

  .news-item {
    flex-direction: row;
    align-items: flex-start;
    padding: 8px 10px;
    gap: 10px;
  }

  .news-cover {
    flex: 0 0 72px;
    width: 72px;
    height: 54px;
  }
}

@media (max-width: 360px) {
  :root {
    --ball-size: clamp(34px, 10.5vw, 40px);
    --ball-gap: clamp(6px, 1.6vw, 8px);
  }

  .number-grid {
    grid-template-columns: repeat(auto-fit, minmax(var(--ball-size), 1fr));
  }
}

.floating-menu {
  position: fixed;
  z-index: 9999;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  user-select: none;
}

.floating-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #f97316;
  color: #fff;
  font-size: 24px;
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.35);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  position: relative;
}

.floating-button::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid #dc2626;
  pointer-events: none;
}

.floating-button:active {
  transform: scale(0.96);
}

.floating-menu-items {
  position: absolute;
  right: 0;
  bottom: 64px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all 0.2s ease;
}

.floating-menu.open .floating-menu-items {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.floating-menu-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
  text-decoration: none;
  padding: 10px 16px;
  background: linear-gradient(135deg, #ffffff, #ffe4e6);
  color: #7f1d1d;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid rgba(248, 113, 113, 0.6);
  box-shadow:
    0 12px 24px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(248, 113, 113, 0.35);
  white-space: nowrap;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.floating-menu-item::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18);
}

.floating-menu-item:hover {
  background: linear-gradient(135deg, #fecaca, #fca5a5);
  color: #7f1d1d;
  transform: translateX(-4px);
  box-shadow:
    0 14px 26px rgba(239, 68, 68, 0.28),
    0 0 0 1px rgba(248, 113, 113, 0.4);
}

.floating-menu-item:active {
  transform: translateX(-2px) scale(0.98);
}

.game-switch-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.game-switch-overlay.hidden {
  display: none;
}

.game-switch-overlay-content {
  background: rgba(255, 255, 255, 0.92);
  color: #7f1d1d;
  border-radius: 16px;
  padding: 18px 24px;
  border: 1px solid #f3b4b4;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.2);
  font-size: 15px;
  font-weight: 600;
}

.live-draw-panel {
  text-align: center;
}

.live-draw {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  padding: 10px 0 6px;
}

.live-meta {
  color: #64748b;
  font-size: 14px;
}

.live-issue {
  font-size: 18px;
  font-weight: 600;
}

.live-time,
.live-next {
  color: #475569;
  font-size: 14px;
}

.live-numbers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  align-items: flex-start;
}

.live-numbers .ball {
  width: clamp(38px, 12vw, 52px);
  height: clamp(38px, 12vw, 52px);
  font-size: 16px;
}

.live-numbers.rolling .ball {
  animation: live-roll 0.6s ease-in-out infinite;
}

.live-empty {
  color: #94a3b8;
  font-size: 14px;
}

@keyframes live-roll {
  0% {
    transform: translateY(0) rotate(0);
  }
  50% {
    transform: translateY(-6px) rotate(4deg);
  }
  100% {
    transform: translateY(0) rotate(0);
  }
}
