:root {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #161b22;
  --panel-strong: #1f2630;
  --text: #f0f6fc;
  --muted: #9da7b3;
  --line: #303947;
  --accent: #2f81f7;
  --accent-strong: #1f6feb;
  --good: #2ea043;
  --bad: #f85149;
  --warn: #d29922;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 20%, rgba(47, 129, 247, 0.16), transparent 30%),
    linear-gradient(135deg, #0d1117 0%, #111827 48%, #151a22 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.home-page {
  background:
    linear-gradient(90deg, rgba(6, 8, 10, 0.9) 0%, rgba(8, 10, 13, 0.65) 42%, rgba(8, 10, 13, 0.45) 100%),
    linear-gradient(180deg, rgba(7, 9, 11, 0.15) 0%, rgba(7, 9, 11, 0.86) 100%),
    url("/yader-bg.png") center / cover fixed;
}

.prank-page {
  background: #000;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.public-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.home-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 52px 0 34px;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  align-content: center;
  align-items: center;
  gap: 34px;
}

.home-hero {
  align-self: center;
  max-width: 620px;
}

.home-logo {
  width: min(460px, 100%);
  height: auto;
  margin: 0 0 6px;
  display: block;
  filter:
    drop-shadow(0 18px 34px rgba(0, 0, 0, 0.86))
    drop-shadow(0 0 18px rgba(0, 0, 0, 0.68))
    drop-shadow(0 0 28px rgba(255, 159, 28, 0.2));
}

.home-lead {
  max-width: 520px;
  margin-bottom: 14px;
  color: rgba(240, 246, 252, 0.86);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.45;
}

.home-actions,
.support-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-action {
  min-height: 52px;
  border-radius: 8px;
  padding: 0 22px;
  background: #ff9f1c;
  color: #101318;
  font-weight: 900;
  text-decoration: none;
  display: inline-grid;
  place-items: center;
  box-shadow: 0 16px 38px rgba(255, 159, 28, 0.22);
}

.primary-action:hover {
  background: #ffc15f;
}

.home-links-column {
  display: grid;
  gap: 18px;
  align-self: center;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.link-section .eyebrow,
.support-section .eyebrow {
  margin-bottom: 4px;
}

.link-tile,
.support-link {
  min-height: 74px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(13, 17, 23, 0.62);
  color: var(--text);
  text-decoration: none;
  backdrop-filter: blur(14px);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.link-tile:hover,
.support-link:hover {
  border-color: rgba(255, 159, 28, 0.72);
  background: rgba(24, 28, 34, 0.78);
  transform: translateY(-2px);
}

.link-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 14px;
  font-weight: 950;
}

.link-tile b,
.support-link b {
  display: block;
  margin-bottom: 2px;
}

.link-tile small,
.support-link small {
  display: block;
  color: rgba(240, 246, 252, 0.68);
  line-height: 1.25;
}

.twitch {
  background: #9146ff;
}

.telegram {
  background: #229ed9;
}

.vk {
  background: #0077ff;
}

.youtube {
  background: #ff0033;
}

.trovo {
  background: #19d66b;
  color: #06120b;
}

.dtf {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.donate {
  background: #f15f2c;
}

.donate-ru {
  background: #ffba08;
  color: #14110c;
  font-size: 22px;
}

.support-section {
  display: grid;
  gap: 10px;
}

.prank-shell {
  min-height: 100vh;
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 20px 0;
}

.prank-panel {
  width: min(760px, 100%);
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
}

.prank-title {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 900;
  line-height: 1.02;
  color: #f5f7fa;
}

.prank-gif {
  width: min(100%, 468px);
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.6);
}

.prank-lead {
  margin: 0;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.35;
  color: rgba(240, 246, 252, 0.88);
}

.prank-actions {
  justify-content: center;
  flex-wrap: nowrap;
}

.prank-actions .support-link {
  min-width: 0;
  width: min(100%, 320px);
}

.back-link {
  margin-top: 18px;
  color: #79c0ff;
  text-decoration: none;
  font-weight: 750;
  display: inline-block;
}

.ticket-switch {
  margin-top: 12px;
}

.back-link:hover {
  text-decoration: underline;
}

.entry-panel,
.panel,
.raffle-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(22, 27, 34, 0.92);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.26);
}

.entry-panel {
  width: min(480px, 100%);
  padding: 32px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #79c0ff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(34px, 6vw, 54px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 18px;
  font-size: 22px;
}

h3 {
  margin-bottom: 4px;
  font-size: 21px;
}

.lead {
  margin-bottom: 26px;
  color: var(--muted);
  line-height: 1.55;
}

.lead-tight {
  margin-bottom: 16px;
}

.form {
  display: grid;
  gap: 16px;
}

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

[hidden] {
  display: none !important;
}

.extra-field {
  animation: slide-in 180ms ease-out;
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

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

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #0d1117;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.18);
}

button,
.secondary-action {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-grid;
  place-items: center;
}

button:hover,
.secondary-action:hover {
  background: var(--accent-strong);
}

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

.ghost-button {
  border: 1px solid var(--line);
  background: transparent;
}

.ghost-button:hover {
  background: var(--panel-strong);
}

.profile-link {
  color: #79c0ff;
  font-weight: 750;
  text-decoration: none;
}

.profile-link:hover {
  text-decoration: underline;
}

.result,
.admin-message,
.empty {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  background: rgba(13, 17, 23, 0.72);
}

.result:empty,
.admin-message:empty {
  display: none;
}

.result > strong,
.result > span {
  display: block;
}

.result > strong {
  margin-bottom: 4px;
  color: var(--text);
}

.verification-text {
  line-height: 1.45;
  min-height: 22px;
  font-weight: 800;
  color: var(--text);
}

.verification-timer {
  display: inline-block;
  min-width: 5ch;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  color: var(--text);
  text-align: center;
}

.verification-timer-row {
  display: block;
  min-height: 22px;
  color: var(--muted);
  line-height: 1.45;
  padding-left: 0;
}

.verification-code-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  min-height: 36px;
  flex-wrap: nowrap;
}

.verification-code-plain {
  font-size: 20px;
  font-weight: 900;
  color: #ffd08a;
  letter-spacing: 0;
  line-height: 1;
}

.verification-copy-button {
  min-height: 34px;
  width: 34px;
  min-width: 34px;
  padding: 0;
  font-size: 16px;
  white-space: nowrap;
  flex: 0 0 34px;
}

.verification-copy-icon {
  display: inline-grid;
  place-items: center;
  width: 100%;
}

.success {
  border-color: rgba(46, 160, 67, 0.55);
}

.error {
  border-color: rgba(248, 81, 73, 0.55);
}

.hint,
.pending {
  border-color: rgba(210, 153, 34, 0.5);
}

.topbar,
.section-head,
.raffle-head,
.metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 14px;
}

.topbar h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 40px);
}

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

.panel {
  padding: 14px;
}

.compact-panel {
  margin-bottom: 14px;
}

.compact-form {
  gap: 12px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
}

.compact-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(260px, auto);
  align-items: end;
  gap: 12px;
}

.compact-toolbar-title h2 {
  margin: 0;
}

.raffle-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}

.draw-fields {
  display: grid;
  grid-template-columns: minmax(220px, 1.8fr) 96px 120px 150px;
  gap: 12px;
  align-items: end;
}

.ticket-closed-actions {
  margin-top: 10px;
}

.ticket-twitch-link {
  width: 100%;
  justify-content: flex-start;
}

.history {
  margin-top: 18px;
}

.raffles {
  display: grid;
  gap: 10px;
}

.raffle-card,
.results-table {
  padding: 12px;
}

.results-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(22, 27, 34, 0.92);
}

.results-table:has(.empty) {
  padding: 0;
  border: 0;
  background: transparent;
}

.raffle-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.status {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.status.active {
  background: rgba(46, 160, 67, 0.16);
  color: #7ee787;
}

.status.closed {
  background: rgba(248, 81, 73, 0.14);
  color: #ffa198;
}

.metrics {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin: 10px 0;
  gap: 8px;
}

.metrics span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--muted);
  background: rgba(13, 17, 23, 0.6);
  font-size: 13px;
}

.metrics b {
  color: var(--text);
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 8px;
}

th,
td {
  border-top: 1px solid var(--line);
  padding: 8px 8px;
  text-align: left;
  font-size: 13px;
}

th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.icon-button {
  min-height: 42px;
  width: 42px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.modal {
  border: 0;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.68);
}

.modal-panel {
  width: min(440px, calc(100vw - 32px));
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(22, 27, 34, 0.98);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
  padding: 16px;
}

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

.modal-head h2 {
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1120px);
    padding: 20px 0;
  }

  .entry-panel,
  .panel,
  .raffle-card {
    padding: 18px;
  }

  .draw-fields,
  .compact-toolbar {
    grid-template-columns: 1fr;
  }

  .topbar,
  .section-head,
  .raffle-head {
    align-items: flex-start;
    flex-direction: column;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}

@media (max-width: 920px) {
  .home-page {
    background:
      linear-gradient(180deg, rgba(6, 8, 10, 0.58) 0%, rgba(6, 8, 10, 0.94) 58%),
      url("/yader-bg.png") center / cover fixed;
  }

  .home-shell {
    grid-template-columns: 1fr;
    align-content: start;
    align-items: start;
    padding-top: 34px;
  }

  .home-hero {
    align-self: end;
  }

  .support-section {
    align-items: stretch;
  }
}

@media (max-width: 560px) {
  .home-shell {
    width: min(100% - 20px, 1180px);
    gap: 24px;
  }

  .home-hero h1 {
    font-size: clamp(52px, 18vw, 86px);
  }

  .link-grid,
  .support-actions {
    grid-template-columns: 1fr;
  }

  .support-actions {
    display: grid;
  }
}
