:root {
  --bg: #0b1020;
  --card: rgba(22, 31, 55, 0.72);
  --card-solid: #141d35;
  --primary: #e11d48;
  --primary-hover: #be123c;
  --primary-soft: rgba(225, 29, 72, 0.14);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --input-bg: rgba(8, 13, 28, 0.55);
  --green: #22c55e;
  --gold: #fbbf24;
  --radius: 20px;
  --shadow: 0 25px 60px -20px rgba(0, 0, 0, 0.75);
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-text);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(1100px 600px at 8% -10%, #2a1445 0%, transparent 55%),
    radial-gradient(900px 600px at 108% 5%, #102447 0%, transparent 50%),
    radial-gradient(800px 700px at 50% 120%, #3b0d1e 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 14px;
  padding:
    calc(24px + env(safe-area-inset-top, 0px))
    calc(14px + env(safe-area-inset-right, 0px))
    calc(24px + env(safe-area-inset-bottom, 0px))
    calc(14px + env(safe-area-inset-left, 0px));
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

.snow-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.snow-canvas.visible {
  opacity: 1;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.28;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background: #be123c;
  top: -140px;
  left: -120px;
}

body::after {
  background: #1d4ed8;
  bottom: -160px;
  right: -120px;
}

.app-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  min-width: 0;
  margin: 0 auto;
  background: linear-gradient(160deg, rgba(30, 41, 72, 0.55), rgba(15, 23, 42, 0.74));
  backdrop-filter: blur(10px) saturate(1.35);
  -webkit-backdrop-filter: blur(10px) saturate(1.35);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 26px 22px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.app-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244, 63, 94, 0.7), transparent);
}

/* ---------------------------- ОБЩЕЕ ---------------------------- */

h1,
h2,
h3 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

h1 {
  font-size: 1.72rem;
  text-align: center;
  font-weight: 700;
  margin-bottom: 8px;
}

h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
}

.subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  margin-bottom: 24px;
}

.screen,
.subscreen {
  display: none;
}

.screen.active,
.subscreen.active {
  display: block;
  animation: fadeIn 0.28s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  display: none !important;
}

.center {
  text-align: center;
}

.hint {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 6px 0 12px;
}

.section-head .hint {
  margin: 0;
}

.screen-title {
  margin-bottom: 16px;
}

.join-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.join-banner {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(125, 211, 252, 0.3);
  background: rgba(56, 189, 248, 0.1);
  color: #bae6fd;
  font-size: 0.82rem;
  line-height: 1.45;
}

.join-by-code-btn {
  width: 100%;
  margin-top: 10px;
}

.invite-link-box {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--input-bg);
}

.invite-link-box > label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.invite-link-row {
  display: flex;
  gap: 8px;
}

.invite-link-row input {
  flex: 1;
  min-width: 0;
  font-size: 0.72rem;
}

.invite-link-row .btn {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}

.brand {
  text-align: center;
  margin-bottom: 18px;
}

.brand-emoji {
  font-size: 2.6rem;
  line-height: 1;
  margin-bottom: 10px;
  filter: drop-shadow(0 8px 18px rgba(225, 29, 72, 0.4));
}

:focus-visible {
  outline: 2px solid rgba(244, 63, 94, 0.75);
  outline-offset: 2px;
}

::selection {
  background: rgba(225, 29, 72, 0.5);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

/* ---------------------------- ФОРМЫ ---------------------------- */

.field {
  min-width: 0;
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}

.field input,
.field textarea,
.field select,
.search-input {
  width: 100%;
  min-width: 0;
  padding: 13px 15px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.field input,
.field select,
.search-input {
  height: 50px;
}

.field select {
  padding-right: 38px;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 19px) calc(50% - 2px),
    calc(100% - 14px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* iOS Safari даёт date/time-инпутам фиксированную внутреннюю ширину,
   из-за чего они вылезают за карточку. Сбрасываем нативный вид. */
.field input[type="date"],
.field input[type="time"],
.field input[type="datetime-local"],
.field input[type="month"],
.field input[type="week"] {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  text-align: left;
}

.field input::-webkit-date-and-time-value {
  min-width: 0;
  text-align: left;
}

@supports (-webkit-touch-callout: none) {
  .field input[type="date"],
  .field input[type="time"],
  .field input[type="datetime-local"],
  .field input[type="month"],
  .field input[type="week"] {
    -webkit-appearance: none;
    appearance: none;
  }
}

.field textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.search-input:focus {
  border-color: rgba(244, 63, 94, 0.7);
  background: rgba(8, 13, 28, 0.75);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.18);
}

.field input::placeholder,
.field textarea::placeholder,
.search-input::placeholder {
  color: var(--muted-2);
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(0.75);
  cursor: pointer;
}

/* ---------------------------- КНОПКИ ---------------------------- */

.btn {
  width: 100%;
  height: 50px;
  min-height: 50px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  position: relative;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s, filter 0.2s, background 0.2s, border-color 0.2s;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

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

.btn-primary {
  background: linear-gradient(135deg, #f43f5e, #be123c);
  box-shadow: 0 10px 24px -10px rgba(225, 29, 72, 0.8);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.btn-outline:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.07);
}

.btn-danger {
  background: rgba(225, 29, 72, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.45);
  color: #fda4af;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(225, 29, 72, 0.22);
}

.btn-sm {
  height: 40px;
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.85rem;
  border-radius: 11px;
}

.btn-link {
  width: 100%;
  background: none;
  border: none;
  color: #fb7185;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  padding: 12px 6px 4px;
}

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

.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.pill-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s, color 0.2s;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.snow-btn.active {
  border-color: rgba(125, 211, 252, 0.4);
  background: rgba(56, 189, 248, 0.14);
  color: #bae6fd;
}

.snow-btn:not(.active) {
  color: var(--muted-2);
}

.music-btn.active {
  border-color: rgba(252, 211, 77, 0.4);
  background: rgba(252, 211, 77, 0.12);
  color: #fde68a;
}

.music-btn:not(.active) {
  color: var(--muted-2);
}

.notif-count {
  position: absolute;
  top: -5px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #131c31;
}

/* ---------------------------- СООБЩЕНИЯ ---------------------------- */

.msg {
  padding: 0;
  border-radius: 11px;
  font-size: 0.86rem;
  line-height: 1.4;
  margin-bottom: 0;
  display: none;
  text-align: center;
}

.msg.error,
.msg.success {
  padding: 11px 13px;
  margin-bottom: 14px;
}

.msg.error {
  display: block;
  background: rgba(127, 29, 29, 0.55);
  color: #fecaca;
  border: 1px solid rgba(153, 27, 27, 0.9);
}

.msg.success {
  display: block;
  background: rgba(20, 83, 45, 0.55);
  color: #bbf7d0;
  border: 1px solid rgba(22, 101, 52, 0.9);
}

/* ---------------------------- ШАПКА ---------------------------- */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  margin-bottom: 14px;
}

.brand-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand-mini span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.user-strip {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  font-size: 0.78rem;
  color: var(--muted);
  padding-bottom: 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

#userBadge {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

/* ---------------------------- ДАШБОРД ---------------------------- */

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 10px;
  min-width: 0;
  margin: 20px 0 10px;
}

.section-head h2,
.section-head h3 {
  min-width: 0;
  overflow-wrap: anywhere;
}

.section-head .hint {
  margin-left: auto;
  text-align: right;
  min-width: 0;
}

.count {
  font-size: 0.8em;
  color: var(--muted);
  font-weight: 600;
}

.card-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.room-card {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px 15px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
}

.room-card:hover {
  border-color: rgba(244, 63, 94, 0.45);
  background: linear-gradient(145deg, rgba(244, 63, 94, 0.08), rgba(255, 255, 255, 0.02));
}

.room-card:active {
  transform: scale(0.99);
}

.room-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.room-card-name {
  font-size: 1rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--muted);
}

.room-card-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-badge {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.role-badge.admin {
  background: rgba(251, 191, 36, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.role-badge.member {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.chip.waiting {
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.chip.drawn {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.32);
}

.create-btn {
  margin-top: 12px;
}

.empty {
  text-align: center;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
  padding: 20px 10px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.015);
}

.invite-card {
  padding: 14px 15px;
  border-radius: 16px;
  border: 1px dashed rgba(244, 63, 94, 0.4);
  background: linear-gradient(145deg, rgba(244, 63, 94, 0.09), rgba(255, 255, 255, 0.015));
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.invite-card-name {
  overflow: hidden;
  font-size: 0.98rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-card-sub {
  font-size: 0.76rem;
  color: var(--muted);
}

.invite-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.invite-actions .btn {
  flex: 1;
  height: 40px;
  min-height: 40px;
  padding: 0 10px;
  font-size: 0.82rem;
  border-radius: 11px;
}

.dashboard-tip {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 24px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.tip-icon {
  flex-shrink: 0;
}

/* ---------------------------- КОМНАТА ---------------------------- */

.room-title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  margin-bottom: 12px;
}

.room-title-row .screen-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.role-badge {
  min-width: 72px;
  flex-shrink: 0;
  text-align: center;
}

.countdown-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 150px;
  text-align: center;
  padding: 20px 16px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  border-radius: 20px;
  margin-bottom: 12px;
  background:
    radial-gradient(120% 140% at 50% -20%, rgba(244, 63, 94, 0.28), transparent 60%),
    linear-gradient(160deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.92));
  border: 1px solid rgba(244, 63, 94, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.countdown-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #fda4af;
  font-weight: 800;
}

.countdown-value {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  justify-items: center;
  gap: 6px;
  width: 100%;
  max-width: 360px;
  min-height: 48px;
  margin: 12px auto 6px;
  font-variant-numeric: tabular-nums;
}

.countdown-value.is-empty {
  display: block;
  min-height: 0;
  margin: 18px auto 12px;
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
}

.cd-part {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  white-space: nowrap;
  line-height: 1;
}

.cd-num {
  font-size: clamp(1.2rem, 5.8vw, 1.55rem);
  font-weight: 700;
  line-height: 1.05;
}

.cd-unit {
  margin-top: 4px;
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--muted);
}

.countdown-sub {
  min-height: 1.4em;
  max-width: 100%;
  overflow: hidden;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.countdown-card.muted {
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.8));
  border-color: var(--border);
}

.countdown-card.muted .countdown-label {
  color: var(--muted);
}

.room-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
  margin-bottom: 14px;
}

.room-meta .hint {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  padding: 11px 14px;
  border-radius: 14px;
  background: rgba(251, 191, 36, 0.07);
  border: 1px solid rgba(251, 191, 36, 0.2);
  font-size: 0.84rem;
  color: #fde68a;
  margin-bottom: 14px;
  line-height: 1.4;
  white-space: nowrap;
}

.admin-prefix,
.admin-you {
  flex-shrink: 0;
}

.admin-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-line b {
  color: #fef3c7;
}

.result-card {
  text-align: center;
  padding: 20px 16px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(34, 197, 94, 0.16), rgba(34, 197, 94, 0.04));
  border: 1px solid rgba(34, 197, 94, 0.35);
  margin-bottom: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.result-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 800;
  color: #86efac;
}

.result-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 1.45rem;
  font-weight: 700;
  color: #bbf7d0;
  margin: 8px 0 6px;
  overflow-wrap: anywhere;
}

.result-note {
  font-size: 0.74rem;
  color: var(--muted);
}

.admin-block {
  margin: 14px 0;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0 6px;
}

.action-grid .btn:only-child {
  grid-column: 1 / -1;
}

.assign-info {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #bbf7d0;
  font-size: 0.8rem;
  line-height: 1.45;
  text-align: center;
}

/* ---------------------------- ПРОФИЛЬ ---------------------------- */

.profile-help-btn {
  width: 100%;
  margin: 0 0 16px;
}

.help-guide-modal {
  max-width: 760px;
}

.help-guide-body {
  max-height: 64svh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  font-size: 0.86rem;
  line-height: 1.55;
}

.help-guide-body h1,
.help-guide-body h2,
.help-guide-body h3,
.help-guide-body h4 {
  margin: 16px 0 8px;
  line-height: 1.25;
  color: var(--text);
}

.help-guide-body h1 {
  font-size: 1.25rem;
}

.help-guide-body h2 {
  font-size: 1.05rem;
}

.help-guide-body h3,
.help-guide-body h4 {
  font-size: 0.95rem;
}

.help-guide-body p {
  margin: 0 0 10px;
}

.help-guide-body strong {
  color: #e2e8f0;
}

.help-guide-body code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.8em;
  overflow-wrap: anywhere;
}

.help-guide-body a {
  color: #7dd3fc;
  overflow-wrap: anywhere;
}

.help-guide-body ul,
.help-guide-body ol {
  margin: 0 0 10px;
  padding-left: 20px;
}

.help-guide-body li {
  margin: 3px 0;
}

.help-guide-body blockquote {
  margin: 10px 0;
  padding: 9px 12px;
  border-left: 3px solid rgba(244, 63, 94, 0.55);
  border-radius: 0 10px 10px 0;
  background: rgba(244, 63, 94, 0.07);
  color: var(--muted);
}

.help-guide-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.guide-table-wrap {
  overflow-x: auto;
  margin: 0 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.guide-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.guide-table-wrap th,
.guide-table-wrap td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: normal;
}

.guide-table-wrap th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.profile-admin-btn {
  width: 100%;
  margin: 0 0 16px;
}

.admin-modal {
  max-width: 760px;
}

.admin-table-wrap {
  max-height: 55svh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.12);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.74rem;
  white-space: nowrap;
}

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

.admin-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #1b2539;
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-table td:first-child {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.66rem;
  color: var(--muted-2);
}

.admin-rooms-toggle {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  color: #bae6fd;
  padding: 4px 8px;
  font: inherit;
  font-size: 0.7rem;
  cursor: pointer;
  white-space: nowrap;
}

.admin-rooms-toggle.open {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
}

.admin-room-details td:first-child {
  font-family: var(--font-text);
  font-size: 0.78rem;
  color: var(--text);
}

.admin-room-details td {
  padding: 4px 8px 12px;
  background: rgba(0, 0, 0, 0.18);
  white-space: normal;
}

.admin-room-details.hidden {
  display: none;
}

.admin-room {
  padding: 9px 11px;
  margin: 6px 0;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
}

.admin-room-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  white-space: normal;
}

.admin-room-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.7rem;
  white-space: normal;
}

.admin-room-gift {
  margin-top: 3px;
  color: #bbf7d0;
  font-size: 0.72rem;
  white-space: normal;
}

.admin-room-empty {
  padding: 10px 4px;
  color: var(--muted);
  font-size: 0.76rem;
  white-space: normal;
}

.admin-table .admin-empty {
  padding: 22px;
  text-align: center;
  color: var(--muted);
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--border);
  margin-bottom: 18px;
}

.avatar.big {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  font-size: 1.2rem;
}

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

.profile-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 1rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.profile-login {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 3px;
}

/* ---------------------------- УЧАСТНИКИ ---------------------------- */

.member-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.member {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
}

.member.me {
  border-color: rgba(244, 63, 94, 0.3);
  background: rgba(244, 63, 94, 0.06);
}

.avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.92rem;
  background: linear-gradient(135deg, #475569, #1e293b);
  color: #e2e8f0;
  text-transform: uppercase;
}

.avatar.admin {
  background: linear-gradient(135deg, #fbbf24, #b45309);
  color: #1c1917;
}

.member-main {
  flex: 1;
  min-width: 0;
}

.member-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.member-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-badge {
  flex-shrink: 0;
}

.member-sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.mini-badge {
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 6px;
  border-radius: 6px;
}

.mini-badge.you {
  background: rgba(244, 63, 94, 0.2);
  color: #fda4af;
}

.mini-badge.admin {
  background: rgba(251, 191, 36, 0.2);
  color: #fcd34d;
}

.status-ok {
  color: #86efac;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.kick-btn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(244, 63, 94, 0.35);
  background: rgba(244, 63, 94, 0.1);
  color: #fda4af;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}

.kick-btn:hover {
  background: rgba(244, 63, 94, 0.22);
}

.wish-btn {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.1);
  color: #fcd34d;
  font-size: 0.86rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wish-btn:hover {
  background: rgba(251, 191, 36, 0.2);
}

.chat-btn {
  position: relative;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.1);
  color: #7dd3fc;
  font-size: 0.86rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-btn:hover {
  background: rgba(56, 189, 248, 0.2);
}

.btn.has-unread::after,
.chat-btn.has-unread::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: #f43f5e;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.9);
}

.btn.has-unread::after {
  top: 8px;
  right: 10px;
  width: 8px;
  height: 8px;
}

.chat-btn.has-unread::after {
  top: 3px;
  right: 3px;
  width: 7px;
  height: 7px;
}

/* ---------------------------- МОДАЛКИ ---------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 18, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  padding:
    calc(18px + env(safe-area-inset-top, 0px))
    calc(18px + env(safe-area-inset-right, 0px))
    calc(18px + env(safe-area-inset-bottom, 0px))
    calc(18px + env(safe-area-inset-left, 0px));
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 36px);
  max-height: calc(100svh - 36px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px;
  border-radius: 22px;
  background: linear-gradient(170deg, rgba(30, 41, 59, 0.97), rgba(15, 23, 42, 0.98));
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.2s;
}

.modal-overlay.active .modal-content {
  transform: none;
}

.modal-small {
  max-width: 360px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  margin-bottom: 14px;
}

.modal-head h2 {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-close {
  position: relative;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-size: 0;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.modal-close::before,
.modal-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.modal-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.modal-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.modal-actions .btn {
  flex: 1;
  min-width: 120px;
}

.confirm-text {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 52vh;
  max-height: 52svh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.notif-item {
  display: flex;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.notif-item.unread {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.25);
}

.notif-item.clickable {
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.notif-item.clickable:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

.notif-item.clickable:focus-visible {
  outline: 2px solid rgba(244, 63, 94, 0.65);
  outline-offset: 2px;
}

.notif-item.clickable .notif-body {
  flex: 1;
}

.notif-item.clickable::after {
  content: "›";
  align-self: center;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
}

.notif-body {
  min-width: 0;
}

.notif-text {
  font-size: 0.83rem;
  line-height: 1.45;
  overflow-wrap: break-word;
}

.notif-time {
  font-size: 0.68rem;
  color: var(--muted-2);
  margin-top: 4px;
}

.rules-box {
  white-space: pre-wrap;
  overflow-wrap: break-word;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #e2e8f0;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  max-height: 45vh;
  max-height: 45svh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.help-meta {
  margin-top: 12px;
  font-size: 0.77rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 5px;
  line-height: 1.4;
}

#btnCloseHelpBottom {
  margin-top: 18px;
}

.anon-actions {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.anon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 7px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  vertical-align: middle;
}

.anon-badge.hidden {
  display: none;
}

.recipient-wishes {
  width: 100%;
  margin: 0 0 14px;
}

.wishlist-empty {
  padding: 28px 14px;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
}

.wishlist-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 2px 0;
}

.wishlist-view-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.wishlist-view-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.wishlist-view-item-label {
  font-size: 0.63rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #fda4af;
}

.wishlist-view-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.wishlist-view-desc {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #cbd5e1;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.wishlist-view-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  font-size: 0.84rem;
  color: var(--text);
}

.wishlist-view-label {
  color: var(--muted);
  flex-shrink: 0;
}

.wishlist-view-price {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.wishlist-link {
  font-size: 0.84rem;
  font-weight: 600;
  color: #fb7185;
  text-decoration: underline;
  overflow-wrap: anywhere;
  word-break: break-all;
}

#btnCloseWishlistViewBottom {
  margin-top: 18px;
}

.wishlist-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 14px;
}

.wishlist-tab {
  position: relative;
  height: 38px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.wishlist-tab.active {
  border-color: rgba(244, 63, 94, 0.45);
  background: rgba(225, 29, 72, 0.14);
  color: #fda4af;
}

.wishlist-tab.has-value::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f43f5e;
}

.chat-modal-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-messages {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  min-height: 180px;
  max-height: 46svh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px;
}

.chat-empty {
  margin: auto;
  padding: 20px 8px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
  text-align: center;
}

.chat-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: fit-content;
  height: auto;
  max-width: 82%;
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 0.86rem;
  line-height: 1.42;
}

.chat-msg-text {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-msg.mine {
  align-self: flex-end;
  border: 1px solid rgba(244, 63, 94, 0.35);
  border-bottom-right-radius: 4px;
  background: rgba(225, 29, 72, 0.2);
}

.chat-msg.theirs {
  align-self: flex-start;
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
}

.chat-msg-time {
  flex: 0 0 auto;
  margin: 0;
  font-size: 0.62rem;
  line-height: 1.2;
  color: var(--muted-2);
  white-space: nowrap;
}

.chat-input-row {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  margin-top: 12px;
}

.chat-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.chat-input:focus {
  border-color: rgba(244, 63, 94, 0.7);
  background: rgba(8, 13, 28, 0.75);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.18);
}

.chat-input::placeholder {
  color: var(--muted-2);
}

.chat-send {
  flex: 0 0 auto;
  width: auto;
  height: 50px;
  padding: 0 16px;
  font-size: 0.9rem;
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  color: var(--muted-2);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.search-input {
  padding: 11px 13px;
  font-size: 0.88rem;
  border-radius: 12px;
}

.invite-candidates {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  max-height: 34vh;
  max-height: 34svh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

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

.candidate-info {
  flex: 1;
  min-width: 0;
}

.candidate-name {
  font-size: 0.86rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-login {
  font-size: 0.69rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-btn {
  flex: 0 0 104px;
  width: 104px;
  height: 32px;
  padding: 0 8px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  border-radius: 9px;
  border: 1px solid rgba(244, 63, 94, 0.35);
  background: rgba(244, 63, 94, 0.14);
  color: #fda4af;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.candidate-btn:hover:not(:disabled) {
  background: rgba(244, 63, 94, 0.25);
}

.candidate-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.candidate-btn.sent {
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.12);
  color: #fcd34d;
}

.candidate-btn.joined {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
  font-weight: 800;
}

.candidate-btn.sent:disabled,
.candidate-btn.joined:disabled {
  opacity: 1;
  cursor: default;
}

.hint.limit-full {
  color: #fda4af;
}

/* ---------------------------- TOAST ---------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  bottom: calc(26px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 20px);
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.96);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.85);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 2000;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  border-color: rgba(244, 63, 94, 0.5);
  color: #fecdd3;
}

.toast.success {
  border-color: rgba(34, 197, 94, 0.4);
  color: #bbf7d0;
}

/* ---------------------------- АДАПТИВ ---------------------------- */

@media (max-width: 480px) {
  body {
    padding: 14px 10px 20px;
    padding:
      calc(14px + env(safe-area-inset-top, 0px))
      calc(10px + env(safe-area-inset-right, 0px))
      calc(20px + env(safe-area-inset-bottom, 0px))
      calc(10px + env(safe-area-inset-left, 0px));
    align-items: flex-start;
  }

  .app-card {
    padding: 22px 16px;
    border-radius: 22px;
  }

  h1 {
    font-size: 1.55rem;
  }

  .header-actions {
    gap: 6px;
  }

  .pill-btn {
    padding: 0 12px;
  }

  .room-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .room-meta .hint {
    width: 100%;
  }

  .countdown-card {
    min-height: 146px;
    padding: 18px 12px;
  }

  .countdown-value {
    gap: 4px;
  }

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

  .action-grid .btn:only-child {
    grid-column: auto;
  }

  .modal-content {
    padding: 18px;
  }

  .notif-list {
    max-height: 46svh;
  }

  .rules-box {
    max-height: 40svh;
  }

  .invite-candidates {
    max-height: 30svh;
  }
}

@media (max-width: 440px) {
  .brand-mini span {
    display: none;
  }

  .candidate {
    gap: 8px;
  }

  .candidate-btn {
    flex-basis: 92px;
    width: 92px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
