﻿:root {
  color-scheme: dark;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.88);
  --line: rgba(255, 255, 255, 0.08);
  --panel: rgba(18, 32, 44, 0.52);
  --panel-strong: rgba(15, 27, 37, 0.62);
  --accent: #ef9b28;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #06111a;
  color: var(--text);
}

body {
  min-height: 100vh;
}

.shell,
.miniapp {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.shell__backdrop,
.shell__overlay,
.miniapp__backdrop,
.miniapp__overlay {
  position: absolute;
  inset: 0;
}

.shell__backdrop,
.miniapp__backdrop {
  background-image: url("/assets/bg_main.png");
  background-size: cover;
  background-position: center center;
  transform: scale(1.03);
  transition: background-image 240ms ease, transform 320ms ease;
}

.shell__overlay,
.miniapp__overlay {
  background:
    linear-gradient(180deg, rgba(7, 19, 29, 0.12) 0%, rgba(7, 19, 29, 0.3) 42%, rgba(5, 12, 18, 0.52) 100%),
    radial-gradient(circle at top, rgba(239, 155, 40, 0.26), transparent 42%);
}

.shell-card,
.snapshot-block {
  position: relative;
  z-index: 1;
  border-radius: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.shell-card {
  width: min(100%, 520px);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 18px 32px;
}

.shell-card--center {
  gap: 14px;
}

.shell-label,
.snapshot-label {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.shell-title,
.snapshot-location {
  margin: 0;
  font-size: clamp(30px, 9vw, 48px);
  line-height: 1.02;
  font-weight: 800;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.shell-text,
.snapshot-status,
.round-number,
.round-task,
.snapshot-empty,
.snapshot-subtitle {
  margin: 0;
  font-size: 18px;
  line-height: 1.45;
  color: var(--text);
}

.snapshot-subtitle,
.round-task,
.snapshot-empty {
  color: var(--muted);
}

.shell-button {
  appearance: none;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: #17202a;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 18px;
  text-align: center;
  text-decoration: none;
}

.shell-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.shell-button--secondary {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.shell-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.shell-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shell-field__label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.shell-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(11, 24, 34, 0.82);
  color: var(--text);
  font-size: 18px;
  line-height: 1.2;
  padding: 14px 16px;
  outline: none;
}

.shell-input:focus {
  border-color: rgba(239, 155, 40, 0.7);
  box-shadow: 0 0 0 3px rgba(239, 155, 40, 0.16);
}

.shell-input:disabled {
  opacity: 0.72;
}

.snapshot-card {
  position: relative;
  z-index: 1;
  width: min(100%, 760px);
  margin: 0 auto;
  min-height: 100vh;
  padding: 28px 18px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.snapshot-block {
  padding: 18px 18px 20px;
}

.snapshot-block--location {
  background: linear-gradient(180deg, rgba(15, 29, 42, 0.32), rgba(10, 21, 31, 0.56));
}

.snapshot-block__topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.snapshot-block__topline .snapshot-label {
  margin-bottom: 0;
}

.favorite-room-button {
  width: 25px;
  height: 25px;
  border: 1px solid rgba(239, 155, 40, 0.38);
  border-radius: 10px;
  background: rgba(239, 155, 40, 0.14);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.favorite-room-button:disabled {
  opacity: 0.72;
  cursor: wait;
}

.profile-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-item {
  padding: 14px 14px 16px;
  border-radius: 18px;
  background: var(--panel-strong);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-item__title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.profile-item__entries {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

.round-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.round-number {
  font-size: 22px;
  font-weight: 700;
}

.miniapp--loading .snapshot-card {
  opacity: 0.88;
}

.auth-toolbar {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 30;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.auth-toolbar__home,
.auth-toolbar__favorites,
.auth-toolbar__auth {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(11, 24, 34, 0.62);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  text-decoration: none;
}

.auth-toolbar__auth {
  cursor: pointer;
}

.auth-toolbar__auth.is-authenticated {
  background: linear-gradient(180deg, rgba(239, 155, 40, 0.95), rgba(204, 124, 25, 0.92));
  border-color: rgba(239, 155, 40, 0.72);
  color: #17202a;
}

.auth-toolbar__home,
.auth-toolbar__favorites {
  background: rgba(239, 155, 40, 0.18);
}

.auth-toolbar__icon,
.auth-toolbar__auth-avatar {
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
}

.auth-panel {
  position: absolute;
  top: 60px;
  right: 0;
  width: min(88vw, 280px);
  border-radius: 20px;
  background: rgba(10, 20, 30, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(18px);
  padding: 16px;
}

.auth-panel__title {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-provider-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-provider {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.auth-provider--google {
  background: rgba(239, 155, 40, 0.18);
}

.auth-provider--disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-provider--logout {
  margin-top: 12px;
}

.auth-account {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-account__avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.auth-account__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-account__name,
.auth-account__provider {
  margin: 0;
}

.auth-account__provider {
  color: var(--muted);
  font-size: 14px;
}

.auth-favorites-meta {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.auth-favorites-meta p {
  margin: 0 0 8px;
}

.auth-favorites-meta p:last-child {
  margin-bottom: 0;
}

.favorites-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.favorites-item {
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: 100%;
}

.favorites-item--refresh {
  animation: favoritesItemRefresh 220ms ease-out;
}

.favorites-item__open {
  flex: 1 1 auto;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: var(--panel-strong);
  color: var(--text);
  padding: 16px;
  text-align: left;
  cursor: pointer;
}

.favorites-item__open:disabled {
  opacity: 0.72;
  cursor: default;
}

.favorites-item__delete {
  flex: 0 0 auto;
  align-self: stretch;
  width: 46px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
}

.favorites-item__delete:disabled {
  opacity: 0.72;
  cursor: wait;
}

.favorites-item__title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
}

.favorites-item__meta,
.favorites-item__hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.favorites-item__hint {
  margin-top: 8px;
}

@keyframes favoritesItemRefresh {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

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

.app-notification {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 40;
  max-width: min(92vw, 460px);
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(10, 20, 30, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
  color: var(--text);
}

.app-notification--error {
  border-color: rgba(220, 92, 92, 0.42);
}

.pwa-install-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 35;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(239, 155, 40, 0.95), rgba(255, 207, 114, 0.94));
  color: #08131c;
  font-weight: 800;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.pwa-prompt {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(4, 10, 16, 0.72);
  backdrop-filter: blur(14px);
}

.pwa-prompt__card {
  width: min(100%, 420px);
  display: grid;
  gap: 16px;
  padding: 22px 20px;
  border-radius: 24px;
  background: rgba(10, 20, 30, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.42);
}

.pwa-prompt__title {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pwa-prompt__body {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.45;
}

.pwa-prompt__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pwa-card {
  width: 100%;
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
}

.pwa-card__row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.pwa-card__label,
.pwa-card__status {
  margin: 0;
}

.pwa-card__label {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.pwa-card__status {
  color: var(--muted);
  line-height: 1.45;
}

.pwa-card__button {
  min-width: 128px;
}

.qr-scanner {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(4, 10, 16, 0.82);
  backdrop-filter: blur(14px);
}

.qr-scanner__card {
  width: min(100%, 480px);
  display: grid;
  gap: 16px;
  padding: 22px 20px;
  border-radius: 24px;
  background: rgba(10, 20, 30, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.42);
}

.qr-scanner__title {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.qr-scanner__viewport {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border-radius: 22px;
  background: rgba(5, 12, 18, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.qr-scanner__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.qr-scanner__guide {
  position: absolute;
  inset: 14%;
  border: 2px solid rgba(239, 155, 40, 0.92);
  border-radius: 24px;
  box-shadow:
    0 0 0 999px rgba(6, 17, 26, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.qr-scanner__status {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
}

@media (min-width: 700px) {
  .snapshot-card,
  .shell-card {
    width: 430px;
  }
}

@media (max-width: 640px) {
  .pwa-card__row {
    flex-direction: column;
    align-items: stretch;
  }

  .pwa-card__button {
    width: 100%;
  }
}
