:root {
  --tg-bg: var(--tg-theme-bg-color, #f2f1ed);
  --tg-text: var(--tg-theme-text-color, #171717);
  --tg-hint: var(--tg-theme-hint-color, #777773);
  --tg-link: var(--tg-theme-link-color, #e22626);
  --tg-button: var(--tg-theme-button-color, #ee2929);
  --tg-button-text: var(--tg-theme-button-text-color, #ffffff);
  --tg-secondary-bg: var(--tg-theme-secondary-bg-color, #ffffff);
  --surface: color-mix(in srgb, var(--tg-secondary-bg) 94%, var(--tg-text) 6%);
  --surface-raised: var(--tg-secondary-bg);
  --line: color-mix(in srgb, var(--tg-text) 13%, transparent);
  --muted: var(--tg-hint);
  --red: #f02b2b;
  --red-dark: #c81419;
  --ink: #111111;
  --cream: #f4f2ed;
  --green: #16a364;
  --amber: #dc8500;
  --danger: #d91f2a;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --shadow: 0 16px 44px rgba(10, 10, 10, .12);
  --header-height: 62px;
  --nav-height: 76px;
  --safe-top: max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px));
  --safe-right: max(env(safe-area-inset-right, 0px), var(--tg-safe-area-inset-right, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --safe-left: max(env(safe-area-inset-left, 0px), var(--tg-safe-area-inset-left, 0px));
  --content-safe-bottom: max(var(--safe-bottom), var(--tg-content-safe-area-inset-bottom, 0px));
  font-family: Inter, "SF Pro Display", "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--tg-text);
  background: var(--tg-bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--tg-bg);
  scroll-behavior: smooth;
}

body {
  min-width: 280px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 95% 8%, color-mix(in srgb, var(--red) 9%, transparent), transparent 24rem),
    var(--tg-bg);
  color: var(--tg-text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button,
label,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--red) 45%, transparent);
  outline-offset: 2px;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[hidden] {
  display: none !important;
}

.boot-screen {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 20px;
  padding: 24px;
  background: #111;
  color: #fff;
  text-align: center;
  transition: opacity .25s ease, visibility .25s ease;
}

.boot-screen.leaving {
  opacity: 0;
  visibility: hidden;
}

.boot-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: clamp(30px, 11vw, 48px);
  font-weight: 950;
  font-style: italic;
  letter-spacing: -3px;
}

.boot-mark span:first-child {
  color: var(--red);
}

.boot-mark i {
  width: 4px;
  height: 37px;
  background: var(--red);
  transform: skewX(-14deg);
  box-shadow: 9px 0 0 color-mix(in srgb, var(--red) 65%, transparent);
}

.boot-line {
  width: min(230px, 64vw);
  height: 3px;
  overflow: hidden;
  background: #333;
  transform: skewX(-18deg);
}

.boot-line span {
  display: block;
  width: 42%;
  height: 100%;
  background: var(--red);
  animation: boot-race 1s infinite ease-in-out;
}

.boot-screen p {
  margin: 0;
  color: #a8a8a8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}

@keyframes boot-race {
  from { transform: translateX(-110%); }
  to { transform: translateX(350%); }
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(var(--header-height) + var(--safe-top));
  padding: var(--safe-top) calc(17px + var(--safe-right)) 0 calc(17px + var(--safe-left));
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: linear-gradient(110deg, rgba(24, 24, 24, .98), rgba(11, 11, 11, .98));
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
}

.app-header::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--red), color-mix(in srgb, var(--red) 40%, transparent) 48%, transparent 82%);
  pointer-events: none;
}

.brand {
  position: relative;
  display: block;
  flex: 0 0 112px;
  width: 112px;
  height: 44px;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

.brand-logo {
  position: absolute;
  top: -12px;
  left: 2px;
  display: block;
  width: 98px;
  max-width: none;
  height: auto;
  pointer-events: none;
}

.stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 124px);
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  color: #fff;
  box-shadow: inset 0 1px rgba(255, 255, 255, .06);
  font-size: 11px;
  white-space: nowrap;
}

.stage-badge span {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 13%, transparent);
}

.stage-badge b {
  overflow: hidden;
  font-weight: 850;
  text-overflow: ellipsis;
}

.app-main {
  width: 100%;
  max-width: 720px;
  min-height: calc(100dvh - var(--header-height));
  margin: 0 auto;
  padding-bottom: calc(var(--nav-height) + var(--content-safe-bottom) + 28px);
}

.screen {
  animation: screen-enter .28s ease both;
}

@keyframes screen-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  padding: 54px 22px 38px;
  background:
    linear-gradient(155deg, transparent 54%, rgba(240, 43, 43, .17) 54.2%, transparent 75%),
    radial-gradient(circle at 86% 12%, rgba(240, 43, 43, .28), transparent 27%),
    #121212;
  color: #fff;
}

.hero::before {
  content: "FR";
  position: absolute;
  right: -19px;
  bottom: -48px;
  color: rgba(255, 255, 255, .025);
  font-size: 230px;
  font-weight: 950;
  font-style: italic;
  line-height: 1;
  letter-spacing: -25px;
}

.speed-lines {
  position: absolute;
  top: 48px;
  right: -16px;
  display: grid;
  gap: 8px;
  transform: skewX(-32deg);
}

.speed-lines i {
  width: 92px;
  height: 3px;
  background: var(--red);
}

.speed-lines i:nth-child(2) { width: 62px; opacity: .55; }
.speed-lines i:nth-child(3) { width: 34px; opacity: .25; }

.eyebrow,
.kicker {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hero h1 {
  position: relative;
  max-width: 570px;
  margin: 0;
  font-size: clamp(42px, 12.7vw, 76px);
  font-weight: 950;
  line-height: .94;
  letter-spacing: -.055em;
  text-transform: uppercase;
}

.hero h1 em {
  color: var(--red);
  font-style: italic;
}

.hero-copy {
  position: relative;
  max-width: 450px;
  margin: 24px 0 0;
  color: #c4c4c4;
  font-size: 15px;
  line-height: 1.55;
}

.hero-stage {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  font-size: 12px;
}

.hero-stage span {
  padding: 5px 8px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  transform: skewX(-8deg);
}

.hero-stage strong {
  font-size: 13px;
}

.hero-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 25px;
}

.button {
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.15;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease, background-color .15s ease;
}

.button:active,
.round-button:active,
.bottom-nav button:active,
.filter-chip:active {
  transform: scale(.96);
}

.button:disabled,
.round-button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.button svg {
  width: 20px;
  height: 20px;
}

.button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--red);
  color: #fff;
  box-shadow: 0 7px 18px rgba(235, 38, 43, .23);
}

.button-primary:hover {
  background: var(--red-dark);
}

.button-secondary {
  border: 1px solid var(--line);
  background: var(--surface-raised);
  color: var(--tg-text);
}

.button-ghost-on-dark {
  border: 1px solid rgba(255, 255, 255, .26);
  background: rgba(255, 255, 255, .06);
  color: #fff;
}

.button-text {
  background: transparent;
  color: var(--muted);
}

.button-wide {
  width: 100%;
}

.section-block {
  padding: 42px 18px;
}

.section-heading,
.work-meta,
.field-label-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.section-heading h2,
.prize-copy h2,
.home-cta h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: -.035em;
}

.stage-number {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.stage-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.stage-track li {
  position: relative;
  min-width: 0;
  color: var(--muted);
}

.stage-track li::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 13px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--line);
}

.stage-track li:first-child::before {
  left: 50%;
  width: 50%;
}

.stage-track li:last-child::before {
  width: 50%;
}

.stage-track li span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  margin: 0 auto;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--tg-bg);
  font-size: 8px;
  font-weight: 900;
}

.stage-track li b {
  display: block;
  margin-top: 9px;
  font-size: 8px;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
}

.stage-track li.done,
.stage-track li.active {
  color: var(--red);
}

.stage-track li.done::before {
  background: var(--red);
}

.stage-track li.done span {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.stage-track li.active span {
  border-color: var(--red);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--red) 12%, transparent);
}

.deadline-card {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 25px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
}

.deadline-card svg {
  width: 27px;
  height: 27px;
  color: var(--red);
}

.deadline-card span,
.deadline-card strong {
  display: block;
}

.deadline-card span {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.deadline-card strong {
  font-size: 14px;
}

.prize-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(125px, .8fr) 1.2fr;
  min-height: 310px;
  overflow: hidden;
  margin: 0 18px;
  border-radius: var(--radius-lg);
  background: #111;
  color: #fff;
}

.prize-card::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -45px;
  width: 230px;
  height: 100px;
  background: var(--red);
  opacity: .28;
  transform: rotate(-17deg);
  filter: blur(45px);
}

.prize-art {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(148deg, #272727, #151515);
}

.prize-number {
  position: absolute;
  left: -10px;
  bottom: -43px;
  color: rgba(255, 255, 255, .05);
  font-size: 210px;
  font-weight: 950;
  font-style: italic;
  line-height: 1;
}

.prize-art svg {
  position: relative;
  z-index: 1;
  width: 145px;
  max-width: 110%;
  overflow: visible;
  filter: drop-shadow(0 18px 14px rgba(0, 0, 0, .45));
}

.prize-art .shirt-shadow {
  fill: #000;
  stroke: none;
  transform: translate(5px, 8px);
  opacity: .5;
}

.prize-art .shirt {
  fill: #f1f0ec;
  stroke: #fff;
  stroke-width: 2;
  stroke-linejoin: round;
}

.prize-art .shirt-line {
  fill: none;
  stroke: #aaa9a5;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.prize-art .shirt-logo {
  fill: var(--red);
  stroke: none;
}

.prize-copy {
  position: relative;
  z-index: 2;
  align-self: center;
  padding: 28px 20px;
}

.kicker-light {
  color: #ff5252;
}

.prize-copy ul {
  display: grid;
  gap: 12px;
  margin: 21px 0 0;
  padding: 0;
  list-style: none;
}

.prize-copy li {
  position: relative;
  padding-left: 19px;
  color: #d1d1d1;
  font-size: 12px;
  line-height: 1.35;
}

.prize-copy li::before {
  content: "";
  position: absolute;
  top: .4em;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--red);
  transform: skewX(-20deg);
}

.home-cta {
  margin: 44px 18px 12px;
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
}

.home-cta h2 {
  max-width: 400px;
  margin-bottom: 22px;
}

.screen-heading {
  display: block;
  padding: 35px 18px 20px;
}

.screen-heading.compact {
  padding-bottom: 16px;
}

.screen-heading h1 {
  margin: 0;
  font-size: clamp(33px, 10vw, 50px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: -.05em;
  text-transform: uppercase;
}

.screen-heading > p:last-child {
  max-width: 450px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 18px 16px;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.filter-chip.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.inline-loader {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 220px;
  padding: 36px;
  color: var(--muted);
}

.inline-loader span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  animation: loader-dot .8s infinite alternate ease-in-out;
}

.inline-loader span:nth-child(2) { animation-delay: .14s; }
.inline-loader span:nth-child(3) { animation-delay: .28s; }

.inline-loader p {
  flex-basis: 100%;
  margin: 7px 0 0;
  font-size: 12px;
  text-align: center;
}

@keyframes loader-dot {
  from { opacity: .25; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(-3px); }
}

.empty-state {
  margin: 12px 18px;
  padding: 42px 25px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-raised) 60%, transparent);
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--red) 11%, transparent);
  color: var(--red);
  transform: rotate(-5deg);
}

.empty-icon svg {
  width: 30px;
  height: 30px;
}

.empty-state h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -.03em;
}

.empty-state p {
  margin: 8px auto 21px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.gallery {
  padding: 0 18px 26px;
}

.work-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow);
}

.work-card.card-leave-left { animation: card-left .18s ease both; }
.work-card.card-leave-right { animation: card-right .18s ease both; }

@keyframes card-left { to { opacity: 0; transform: translateX(-16px) rotate(-1deg); } }
@keyframes card-right { to { opacity: 0; transform: translateX(16px) rotate(1deg); } }

.work-image-wrap {
  position: relative;
  aspect-ratio: 4 / 4.35;
  overflow: hidden;
  background: color-mix(in srgb, var(--tg-text) 7%, var(--tg-bg));
  cursor: zoom-in;
}

.work-image-wrap img,
.preview-image img,
.my-card-image img,
.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.work-image-wrap img {
  opacity: 0;
  transition: opacity .2s ease;
}

.work-image-wrap img.loaded {
  opacity: 1;
}

.image-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--tg-text) 7%, transparent) 50%, transparent 70%);
  background-size: 220% 100%;
  animation: skeleton 1.1s infinite linear;
}

@keyframes skeleton { to { background-position-x: -220%; } }

.work-number,
.my-vote-badge {
  position: absolute;
  top: 14px;
  padding: 8px 11px;
  border-radius: 999px;
  box-shadow: 0 4px 13px rgba(0, 0, 0, .2);
  font-size: 10px;
  font-weight: 900;
  backdrop-filter: blur(10px);
}

.work-number {
  left: 14px;
  background: rgba(17, 17, 17, .87);
  color: #fff;
}

.my-vote-badge {
  right: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, .9);
  color: #111;
}

.my-vote-badge svg {
  width: 14px;
  height: 14px;
  color: var(--green);
  stroke-width: 2.5;
}

.work-body {
  padding: 19px 19px 22px;
}

.work-meta {
  align-items: center;
}

.work-meta span {
  color: var(--red);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.work-meta b {
  color: var(--muted);
  font-size: 11px;
}

.work-body h2 {
  margin: 10px 0 7px;
  font-size: 24px;
  line-height: 1.08;
  letter-spacing: -.035em;
}

.work-body p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.gallery-controls {
  display: grid;
  grid-template-columns: 50px 1fr 50px;
  gap: 10px;
  margin-top: 15px;
}

.round-button {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-raised);
  color: var(--tg-text);
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease;
}

.round-button svg {
  width: 22px;
  height: 22px;
}

.vote-button svg {
  width: 19px;
  height: 19px;
}

.vote-button.selected {
  background: var(--green);
  box-shadow: 0 7px 18px rgba(22, 163, 100, .2);
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  margin: 17px 6px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
}

.privacy-note svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
}

.submission-closed {
  margin: 8px 18px;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
}

.closed-icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  margin-bottom: 17px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--red) 10%, transparent);
  color: var(--red);
}

.closed-icon svg {
  width: 25px;
  height: 25px;
}

.submission-closed h2 {
  margin: 0;
  font-size: 22px;
}

.submission-closed p {
  margin: 8px 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.submission-form {
  padding: 3px 18px 30px;
  scroll-margin-top: 74px;
}

.form-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin: 0 0 18px;
}

.form-progress span {
  height: 4px;
  border-radius: 99px;
  background: var(--line);
  transition: background .2s ease;
}

.form-progress span.active,
.form-progress span.done {
  background: var(--red);
}

.form-step {
  margin: 0;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
}

.form-step legend {
  float: left;
  width: 100%;
  margin: 0 0 22px;
  padding: 0;
  font-size: 26px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -.035em;
}

.form-step legend + * {
  clear: both;
}

.form-step legend small {
  display: block;
  margin-bottom: 7px;
  color: var(--red);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.rules-preview {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--tg-bg) 70%, var(--surface-raised));
}

.rules-preview ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rules-preview li {
  position: relative;
  padding-left: 18px;
  color: color-mix(in srgb, var(--tg-text) 80%, var(--muted));
  font-size: 12px;
  line-height: 1.45;
}

.rules-preview li::before {
  content: "";
  position: absolute;
  top: .48em;
  left: 1px;
  width: 7px;
  height: 7px;
  background: var(--red);
  transform: rotate(45deg);
}

.logo-download-inline {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 11px;
  margin-top: 15px;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--red) 32%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--red) 6%, var(--surface-raised));
  color: var(--tg-text);
  text-decoration: none;
}

.logo-download-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: #171717;
  color: var(--red);
  font-size: 14px;
  font-weight: 950;
  font-style: italic;
}

.logo-download-inline strong,
.logo-download-inline small {
  display: block;
}

.logo-download-inline strong { font-size: 11px; }

.logo-download-inline small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.logo-download-inline > svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--red);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-asset-card {
  display: grid;
  grid-template-columns: minmax(105px, .85fr) 1.15fr;
  overflow: hidden;
  margin-top: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}

.brand-asset-preview {
  display: grid;
  min-height: 170px;
  place-items: center;
  padding: 17px;
  background: #151515;
}

.brand-asset-preview img {
  display: block;
  width: 100%;
  max-width: 180px;
  height: auto;
}

.brand-asset-copy {
  align-self: center;
  padding: 18px 16px;
}

.brand-asset-copy > small {
  color: var(--red);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.brand-asset-copy h3 {
  margin: 7px 0;
  font-size: 17px;
}

.brand-asset-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.brand-asset-copy a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-top: 13px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  text-decoration: none;
}

.text-button {
  margin-top: 13px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--tg-link);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.agreement-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 18px 0 8px;
  cursor: pointer;
}

.agreement-box input,
.category-option input,
.contact-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.checkmark {
  display: grid;
  flex: 0 0 auto;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 7px;
  color: #fff;
  transition: background .15s ease, border-color .15s ease;
}

.checkmark svg {
  width: 15px;
  height: 15px;
  opacity: 0;
  stroke-width: 3;
}

.agreement-box input:checked + .checkmark {
  border-color: var(--red);
  background: var(--red);
}

.agreement-box input:checked + .checkmark svg {
  opacity: 1;
}

.agreement-box > span:last-child {
  padding-top: 1px;
  font-size: 12px;
  line-height: 1.5;
}

.field-error {
  min-height: 16px;
  margin: 5px 0 8px;
  color: var(--danger);
  font-size: 11px;
  font-weight: 700;
}

.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.category-option {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  padding: 15px 10px 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--tg-bg) 70%, var(--surface-raised));
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.category-option:has(input:checked) {
  border-color: var(--red);
  background: color-mix(in srgb, var(--red) 7%, var(--surface-raised));
}

.category-option:has(input:focus-visible) {
  outline: 3px solid color-mix(in srgb, var(--red) 35%, transparent);
  outline-offset: 2px;
}

.category-wide {
  grid-column: 1 / -1;
  flex-direction: row;
  justify-content: center;
  gap: 15px;
  text-align: left;
}

.category-visual {
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  margin-bottom: 9px;
  border-radius: 17px;
  background: #171717;
  color: #fff;
}

.category-wide .category-visual {
  margin: 0;
}

.category-visual svg {
  width: 50px;
  height: 50px;
  overflow: visible;
}

.category-visual .garment-body {
  fill: currentColor;
  stroke: rgba(255, 255, 255, .72);
  stroke-width: 1;
  stroke-linejoin: round;
}

.category-visual .garment-collar {
  fill: #171717;
  stroke: none;
}

.category-visual .garment-mark {
  fill: var(--red);
  stroke: none;
}

.category-visual .garment-band {
  fill: #fff;
  opacity: .92;
}

.category-visual .garment-number {
  fill: var(--red);
}

.jersey-visual { color: var(--red); }
.tshirt-visual { color: #f2f1ed; }
.kit-visual { color: #c9c9c9; }
.tshirt-visual .garment-body { stroke: #fff; }
.kit-visual .kit-jersey .garment-body { fill: var(--red); }
.kit-visual .kit-tshirt .garment-body { fill: #f2f1ed; stroke: #fff; }

.category-option strong,
.category-option small {
  display: block;
}

.contact-block {
  margin-top: 19px;
}

.contact-heading {
  margin: 0 0 9px;
  font-size: 11px;
  font-weight: 800;
}

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

.contact-option {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 76px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.contact-option:active {
  transform: scale(.98);
}

.contact-option:has(input:checked) {
  border-color: var(--red);
  background: color-mix(in srgb, var(--red) 7%, var(--surface-raised));
}

.contact-option:has(input:focus-visible) {
  outline: 3px solid color-mix(in srgb, var(--red) 35%, transparent);
  outline-offset: 2px;
}

.contact-option strong {
  overflow: hidden;
  max-width: 100%;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-logo {
  display: grid;
  min-width: 31px;
  height: 25px;
  place-items: center;
  padding: 0 5px;
  border-radius: 7px;
  color: #fff;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: -.03em;
}

.contact-logo-telegram { background: #229ed9; }
.contact-logo-vk { background: #0077ff; }
.contact-logo-max { background: linear-gradient(135deg, #7b61ff, #ff4d8d); }

.contact-field {
  margin-top: 11px;
}

.category-option strong {
  font-size: 13px;
}

.category-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.3;
}

.field {
  display: block;
  margin-top: 17px;
}

.field > span:first-child,
.field-label-row {
  display: block;
  margin-bottom: 7px;
  font-size: 11px;
  font-weight: 800;
}

.field-label-row {
  display: flex;
  align-items: center;
}

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

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: 0;
  background: color-mix(in srgb, var(--tg-bg) 65%, var(--surface-raised));
  color: var(--tg-text);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.field input {
  height: 49px;
  padding: 0 14px;
}

.field textarea {
  min-height: 120px;
  padding: 13px 14px;
  line-height: 1.45;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 9%, transparent);
}

.field input::placeholder,
.field textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 72%, transparent);
}

.field > small {
  display: block;
  margin: 6px 2px 0;
  color: var(--muted);
  font-size: 9px;
}

.step-actions {
  display: grid;
  grid-template-columns: minmax(95px, .65fr) 1.35fr;
  gap: 9px;
  margin-top: 21px;
}

.upload-zone {
  position: relative;
  display: block;
  min-height: 230px;
  overflow: hidden;
  border: 2px dashed color-mix(in srgb, var(--tg-text) 20%, transparent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--tg-bg) 70%, var(--surface-raised));
  cursor: pointer;
}

.upload-zone.has-image {
  border-style: solid;
  border-color: var(--red);
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 25px;
  text-align: center;
}

.upload-icon {
  display: grid;
  width: 55px;
  height: 55px;
  place-items: center;
  margin-bottom: 13px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--red) 11%, transparent);
  color: var(--red);
}

.upload-icon svg {
  width: 26px;
  height: 26px;
}

.upload-placeholder strong {
  font-size: 14px;
}

.upload-placeholder small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.upload-preview {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--tg-text) 5%, var(--tg-bg));
}

.replace-label {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 9px;
  border-radius: 999px;
  background: rgba(17, 17, 17, .82);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}

.preview-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--tg-bg) 65%, var(--surface-raised));
}

.preview-image {
  aspect-ratio: 4 / 3.7;
  background: color-mix(in srgb, var(--tg-text) 5%, var(--tg-bg));
}

.preview-body {
  padding: 16px;
}

.preview-body > span {
  color: var(--red);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.preview-body h2 {
  margin: 7px 0 5px;
  font-size: 20px;
}

.preview-body p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.preview-body .preview-contact {
  margin-top: 10px;
  color: var(--tg-text);
  font-weight: 800;
}

.confirm-note {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--tg-link) 7%, transparent);
  color: var(--tg-link);
}

.confirm-note svg {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
}

.confirm-note p {
  margin: 0;
  color: var(--tg-text);
  font-size: 10px;
  line-height: 1.45;
}

.my-list {
  display: grid;
  gap: 13px;
  padding: 0 18px 30px;
}

.my-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}

.my-card-main {
  display: grid;
  grid-template-columns: 112px 1fr;
  min-height: 130px;
}

.my-card-image {
  position: relative;
  min-height: 130px;
  background: color-mix(in srgb, var(--tg-text) 5%, var(--tg-bg));
  cursor: zoom-in;
}

.my-card-info {
  min-width: 0;
  padding: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 5px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 12%, transparent);
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.status-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.status-approved { background: color-mix(in srgb, var(--green) 12%, transparent); color: var(--green); }
.status-pill.status-pending { background: color-mix(in srgb, var(--amber) 12%, transparent); color: var(--amber); }
.status-pill.status-revision_requested,
.status-pill.status-rejected,
.status-pill.status-disqualified { background: color-mix(in srgb, var(--danger) 11%, transparent); color: var(--danger); }

.my-card h2 {
  overflow: hidden;
  margin: 9px 0 4px;
  font-size: 17px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-card-meta {
  color: var(--muted);
  font-size: 9px;
}

.moderation-reason {
  margin: 0;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--danger) 5%, transparent);
  color: var(--tg-text);
  font-size: 10px;
  line-height: 1.45;
}

.moderation-reason strong {
  display: block;
  margin-bottom: 2px;
  color: var(--danger);
}

.my-card-actions {
  display: flex;
  justify-content: flex-end;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.replace-button {
  min-height: 38px;
  padding: 0 12px;
  font-size: 11px;
}

.replace-button svg {
  width: 16px;
  height: 16px;
}

.info-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 18px 18px;
  padding: 4px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--tg-text) 7%, transparent);
}

.info-tabs button {
  position: relative;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.info-tabs button.active {
  background: var(--surface-raised);
  color: var(--tg-text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .07);
}

.tab-dot {
  position: absolute;
  top: 8px;
  right: calc(50% - 42px);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
}

.info-panel {
  padding: 0 18px 32px;
}

.rules-hero {
  position: relative;
  display: flex;
  min-height: 145px;
  align-items: center;
  overflow: hidden;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: #111;
  color: #fff;
}

.rules-hero > span {
  position: absolute;
  right: -10px;
  color: rgba(255, 255, 255, .045);
  font-size: 135px;
  font-weight: 950;
  font-style: italic;
  letter-spacing: -14px;
}

.rules-hero div {
  position: relative;
  z-index: 1;
}

.rules-hero p {
  margin: 0 0 4px;
  color: var(--red);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.rules-hero h2 {
  max-width: 230px;
  margin: 0;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -.04em;
  text-transform: uppercase;
}

.rules-content {
  padding: 22px 3px 7px;
  white-space: pre-line;
}

.rules-content p {
  margin: 0 0 14px;
  color: color-mix(in srgb, var(--tg-text) 87%, var(--muted));
  font-size: 13px;
  line-height: 1.6;
}

.rules-content ol {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rules;
}

.rules-content li {
  position: relative;
  padding: 0 0 14px 43px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.5;
  counter-increment: rules;
}

.rules-content li::before {
  content: counter(rules, decimal-leading-zero);
  position: absolute;
  top: -2px;
  left: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 950;
  font-style: italic;
}

.legal-note {
  padding: 16px;
  border-left: 3px solid var(--red);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: color-mix(in srgb, var(--red) 6%, var(--surface-raised));
}

.legal-note strong {
  font-size: 12px;
}

.legal-note p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.contact-links {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.link-card {
  display: grid;
  grid-template-columns: 42px 1fr 18px;
  align-items: center;
  gap: 11px;
  min-height: 67px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--tg-text);
  text-decoration: none;
}

.link-card > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: color-mix(in srgb, var(--red) 10%, transparent);
  color: var(--red);
}

.link-card svg {
  width: 18px;
  height: 18px;
}

.link-card small,
.link-card strong {
  display: block;
}

.link-card small {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 9px;
}

.link-card strong {
  font-size: 12px;
}

.link-card > svg {
  color: var(--muted);
}

.results-locked {
  padding: 43px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  text-align: center;
}

.results-locked > span {
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  margin: 0 auto 17px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--tg-text) 6%, transparent);
  color: var(--muted);
}

.results-locked svg {
  width: 27px;
  height: 27px;
}

.results-locked h2 {
  margin: 0;
  font-size: 22px;
}

.results-locked p {
  max-width: 350px;
  margin: 9px auto 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.winner-card {
  position: relative;
  overflow: hidden;
  padding: 27px 22px;
  border-radius: var(--radius-lg);
  background: #111;
  color: #fff;
}

.winner-card::after {
  content: "01";
  position: absolute;
  right: -10px;
  bottom: -27px;
  color: rgba(255, 255, 255, .04);
  font-size: 130px;
  font-weight: 950;
  font-style: italic;
  line-height: 1;
}

.winner-card .winner-label {
  color: var(--red);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.winner-card h2 {
  position: relative;
  z-index: 1;
  margin: 10px 0 4px;
  font-size: 29px;
  line-height: 1;
  letter-spacing: -.045em;
}

.winner-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #aaa;
  font-size: 11px;
}

.winner-votes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--red);
  font-size: 11px;
  font-weight: 900;
}

.winner-votes svg {
  width: 15px;
  height: 15px;
}

.tie-message {
  margin-bottom: 12px;
  padding: 15px;
  border: 1px solid color-mix(in srgb, var(--amber) 25%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--amber) 8%, transparent);
  color: var(--tg-text);
  font-size: 12px;
  line-height: 1.5;
}

.result-list {
  display: grid;
  gap: 8px;
  margin-top: 17px;
}

.result-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
}

.result-place {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.result-row strong,
.result-row small {
  display: block;
}

.result-row strong {
  font-size: 12px;
}

.result-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.result-count {
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-height) + var(--content-safe-bottom));
  padding: 7px calc(4px + var(--safe-right)) var(--content-safe-bottom) calc(4px + var(--safe-left));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--tg-secondary-bg) 92%, transparent);
  box-shadow: 0 -7px 24px rgba(0, 0, 0, .06);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
}

.bottom-nav button {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: transform .15s ease, color .15s ease;
}

.bottom-nav button.active {
  color: var(--red);
}

.bottom-nav button > svg {
  width: 22px;
  height: 22px;
}

.bottom-nav button > span:last-child {
  overflow: hidden;
  max-width: 100%;
  font-size: 9px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-nav .nav-submit {
  overflow: visible;
}

.nav-submit-icon {
  display: grid;
  width: 47px;
  height: 47px;
  place-items: center;
  margin-top: -24px;
  border: 4px solid var(--tg-secondary-bg);
  border-radius: 16px;
  background: var(--red);
  color: #fff;
  box-shadow: 0 7px 17px rgba(240, 43, 43, .25);
  transform: rotate(45deg);
}

.nav-submit-icon svg {
  width: 22px;
  height: 22px;
  transform: rotate(-45deg);
  stroke-width: 2.3;
}

.bottom-nav .nav-submit > span:last-child {
  margin-top: 1px;
}

.modal-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px max(14px, var(--safe-right)) max(14px, var(--content-safe-bottom)) max(14px, var(--safe-left));
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(4px);
  animation: backdrop-in .2s ease both;
}

@keyframes backdrop-in { from { opacity: 0; } }

.modal {
  position: relative;
  width: min(100%, 480px);
  padding: 28px 21px 15px;
  border-radius: 26px;
  background: var(--tg-secondary-bg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, .3);
  text-align: center;
  animation: modal-up .24s ease both;
}

@keyframes modal-up { from { transform: translateY(35px); opacity: 0; } }

.modal-close {
  position: absolute;
  z-index: 2;
  top: 13px;
  right: 13px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--tg-text) 7%, transparent);
  color: var(--muted);
  cursor: pointer;
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-icon {
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 22px;
  background: color-mix(in srgb, var(--red) 10%, transparent);
  color: var(--red);
  transform: rotate(-5deg);
}

.modal-icon svg {
  width: 31px;
  height: 31px;
  fill: color-mix(in srgb, var(--red) 15%, transparent);
}

.modal h2 {
  margin: 0;
  font-size: 27px;
  line-height: 1.05;
  letter-spacing: -.04em;
}

.modal > p:not(.kicker) {
  margin: 9px 0 21px;
  color: var(--muted);
  font-size: 12px;
}

.modal-notice {
  margin: -8px 0 15px;
  padding: 9px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--amber) 10%, transparent);
  color: color-mix(in srgb, var(--amber) 75%, var(--tg-text));
  font-size: 10px;
}

.modal .button + .button {
  margin-top: 5px;
}

.image-modal {
  position: relative;
  display: grid;
  width: min(100%, 680px);
  max-height: calc(100dvh - var(--safe-top) - var(--content-safe-bottom) - 30px);
  place-items: center;
  overflow: hidden;
  border-radius: 22px;
  background: #111;
  animation: modal-up .24s ease both;
}

.image-modal img {
  display: block;
  width: 100%;
  max-height: calc(100dvh - var(--safe-top) - var(--content-safe-bottom) - 30px);
  object-fit: contain;
}

.image-modal-close {
  background: rgba(0, 0, 0, .65);
  color: #fff;
}

.fatal-screen {
  position: fixed;
  z-index: 110;
  inset: 0;
  overflow-y: auto;
  padding: calc(30px + var(--safe-top)) calc(18px + var(--safe-right)) calc(30px + var(--safe-bottom)) calc(18px + var(--safe-left));
  background: #111;
  color: #fff;
}

.fatal-card {
  width: min(100%, 430px);
  margin: 0 auto;
  padding-top: 8vh;
  text-align: center;
}

.fatal-mark {
  color: #fff;
  font-size: 18px;
  font-weight: 950;
  font-style: italic;
}

.fatal-mark span {
  margin: 0 4px;
  color: var(--red);
}

.fatal-icon {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  margin: 38px auto 21px;
  border-radius: 24px;
  background: rgba(240, 43, 43, .12);
  color: var(--red);
  transform: rotate(-5deg);
}

.fatal-icon svg {
  width: 35px;
  height: 35px;
}

.fatal-card h1 {
  margin: 0;
  font-size: 27px;
  line-height: 1.1;
}

.fatal-card > p {
  margin: 12px auto 24px;
  color: #aaa;
  font-size: 13px;
  line-height: 1.55;
}

.dev-access {
  margin-top: 26px;
  padding: 15px;
  border: 1px solid #343434;
  border-radius: var(--radius-sm);
  text-align: left;
}

.dev-access summary {
  color: #aaa;
  font-size: 11px;
  cursor: pointer;
}

.dev-access .field input {
  border-color: #393939;
  background: #1b1b1b;
  color: #fff;
}

.dev-access > small {
  display: block;
  margin-top: 9px;
  color: #777;
  font-size: 9px;
  line-height: 1.45;
  text-align: center;
}

.toast-region {
  position: fixed;
  z-index: 120;
  top: calc(var(--safe-top) + 13px);
  right: max(13px, var(--safe-right));
  left: max(13px, var(--safe-left));
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  width: min(100%, 430px);
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 13px;
  background: rgba(17, 17, 17, .94);
  color: #fff;
  box-shadow: 0 9px 30px rgba(0, 0, 0, .24);
  font-size: 11px;
  line-height: 1.4;
  backdrop-filter: blur(12px);
  animation: toast-in .22s ease both;
}

.toast::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.toast.error::before { background: var(--danger); }
.toast.warning::before { background: var(--amber); }

.toast.leaving {
  animation: toast-out .2s ease both;
}

@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); } }

@media (min-width: 520px) {
  .hero,
  .app-header {
    border-right: 1px solid var(--line);
    border-left: 1px solid var(--line);
  }

  .hero {
    min-height: 530px;
    padding-right: 40px;
    padding-left: 40px;
    border-radius: 0 0 32px 32px;
  }

  .section-block,
  .screen-heading {
    padding-right: 28px;
    padding-left: 28px;
  }

  .prize-card,
  .home-cta,
  .info-tabs,
  .empty-state,
  .submission-closed {
    margin-right: 28px;
    margin-left: 28px;
  }

  .gallery,
  .submission-form,
  .my-list,
  .info-panel {
    padding-right: 28px;
    padding-left: 28px;
  }

  .filter-row {
    padding-right: 28px;
    padding-left: 28px;
  }

  .bottom-nav {
    right: 50%;
    left: auto;
    width: min(100%, 720px);
    transform: translateX(50%);
    border-right: 1px solid var(--line);
    border-left: 1px solid var(--line);
    border-radius: 20px 20px 0 0;
  }

  .prize-card {
    grid-template-columns: 1fr 1.1fr;
  }
}

@media (min-width: 760px) {
  .app-header {
    right: 50%;
    left: auto;
    width: 720px;
    transform: translateX(50%);
  }
}

@media (max-width: 350px) {
  .hero {
    padding-right: 17px;
    padding-left: 17px;
  }

  .hero-actions {
    display: grid;
  }

  .prize-card {
    grid-template-columns: 1fr;
  }

  .prize-art {
    min-height: 180px;
  }

  .form-step {
    padding: 18px;
  }

  .my-card-main {
    grid-template-columns: 94px 1fr;
  }

  .bottom-nav button > span:last-child {
    font-size: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
