/* Искра — интерфейс гостя на телефоне.
   Принципы: одна задача на экран, кнопки от 60 px, текст от 18 px,
   главное действие внизу под большим пальцем. */

.g-app {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  background:
    radial-gradient(120% 60% at 50% -10%, var(--glow-1), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 400 18px/1.4 var(--font-ui);
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

/* Шапка: знак мероприятия и имя гостя */
.g-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  margin-bottom: 24px;
}
.g-event {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-2);
}
.g-event span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-logo {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font: var(--display-weight) 15px/1 var(--font-display);
}
.g-me {
  flex: none;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.g-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
.g-foot { margin-top: 20px; display: grid; gap: 12px; }

.g-kicker {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.g-title {
  margin: 0 0 12px;
  font: var(--display-weight) 30px/1.12 var(--font-display);
  letter-spacing: var(--display-tracking);
  text-wrap: balance;
}
[data-theme="wedding"] .g-title { font-size: 36px; }
.g-lead { margin: 0 0 24px; color: var(--text-2); }

/* Поля ввода */
.g-field { display: grid; gap: 8px; margin-bottom: 16px; }
.g-label { font-size: 15px; font-weight: 600; color: var(--text-2); }
.g-input,
.g-textarea {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  font: 500 20px/1.35 var(--font-ui);
  outline: none;
  transition: border-color 0.2s;
}
.g-input { height: 64px; padding: 0 20px; }
.g-textarea { min-height: 150px; padding: 16px 20px; resize: none; }
.g-input:focus, .g-textarea:focus, .g-input.is-focus { border-color: var(--accent); }
.g-input::placeholder, .g-textarea::placeholder { color: var(--text-3); }
.g-count { justify-self: end; font-size: 14px; color: var(--text-3); }

/* Кнопки */
.g-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 64px;
  padding: 0 24px;
  border: 0;
  border-radius: 20px;
  background: var(--accent);
  color: var(--on-accent);
  font: 700 20px/1 var(--font-ui);
  cursor: pointer;
  transition: transform 0.15s var(--ease-out), filter 0.15s;
}
.g-btn:active { transform: scale(0.97); filter: brightness(0.95); }
.g-btn--ghost { background: var(--surface); color: var(--text); border: 2px solid var(--line); }
.g-btn--small { min-height: 52px; font-size: 17px; border-radius: 16px; }
.g-btn[disabled] { opacity: 0.4; }

.g-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--surface);
  font-size: 17px;
  font-weight: 500;
}
.g-switch {
  flex: none;
  position: relative;
  width: 52px;
  height: 32px;
  border-radius: 999px;
  background: var(--surface-2);
}
.g-switch::after {
  content: "";
  position: absolute;
  top: 4px; left: 4px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--text-3);
  transition: transform 0.2s var(--ease-out);
}
.g-switch.is-on { background: var(--accent); }
.g-switch.is-on::after { transform: translateX(20px); background: var(--on-accent); }

/* Ожидание */
.g-wait {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
}
.g-orb {
  position: relative;
  width: 168px;
  height: 168px;
  margin-bottom: 28px;
}
.g-orb i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: g-ripple 3s var(--ease-out) infinite;
}
.g-orb i:nth-child(2) { animation-delay: 1s; }
.g-orb i:nth-child(3) { animation-delay: 2s; }
.g-orb b {
  position: absolute;
  inset: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font: var(--display-weight) 34px/1 var(--font-display);
  box-shadow: 0 0 60px var(--glow-1);
}
@keyframes g-ripple {
  0% { transform: scale(0.45); opacity: 0.9; }
  100% { transform: scale(1); opacity: 0; }
}

/* Варианты ответа */
.g-options { display: grid; gap: 12px; }
.g-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 12px 18px;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  font: 600 19px/1.25 var(--font-ui);
  text-align: left;
}
.g-option .g-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid var(--text-3);
  border-radius: 50%;
  color: transparent;
  font-size: 16px;
  font-weight: 800;
}
.g-option.is-multi .g-mark { border-radius: 9px; }
.g-option.is-picked { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.g-option.is-picked .g-mark { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }

.g-yesno { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.g-big {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  aspect-ratio: 1 / 1.15;
  border: 2px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
  color: var(--text);
  font: var(--display-weight) 26px/1 var(--font-display);
}
.g-big em { font-style: normal; font-size: 54px; line-height: 1; }
.g-big.is-picked { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }

.g-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.g-scale button {
  aspect-ratio: 1;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  font: 700 24px/1 var(--font-ui);
}
.g-scale button.is-picked { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.g-scale-ends { display: flex; justify-content: space-between; margin-top: 10px; font-size: 14px; color: var(--text-3); }

/* Реакции */
.g-reacts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.g-react {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  aspect-ratio: 1 / 0.86;
  border: 2px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
  color: var(--text-2);
  font: 600 15px/1 var(--font-ui);
  overflow: hidden;
}
.g-react em { font-style: normal; font-size: 52px; line-height: 1; }
.g-react.is-hit { border-color: var(--accent); color: var(--text); }
.g-react.is-hit::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, var(--glow-1), transparent 70%);
}
.g-react .g-cool {
  position: absolute;
  left: 0; bottom: 0;
  height: 4px;
  background: var(--accent);
  border-radius: 0 4px 4px 0;
}

/* Фото */
.g-photo-pick { display: grid; gap: 14px; }
.g-tile {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 112px;
  padding: 20px 22px;
  border: 2px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}
.g-tile.is-main { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.g-tile svg { flex: none; width: 44px; height: 44px; }
.g-tile b { display: block; font-size: 21px; margin-bottom: 4px; }
.g-tile small { font-size: 15px; opacity: 0.75; }

.g-preview {
  position: relative;
  aspect-ratio: 4 / 5;
  margin-bottom: 14px;
  border-radius: 22px;
  overflow: hidden;
  background: var(--surface-2);
}
.g-preview .ph { position: absolute; inset: 0; }
.g-progress {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.g-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}
.g-status { display: flex; justify-content: space-between; margin: 10px 0 0; font-size: 15px; color: var(--text-2); }

/* Готово */
.g-done { flex: 1; display: grid; place-content: center; justify-items: center; text-align: center; }
.g-check {
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
  margin-bottom: 26px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ok) 18%, transparent);
  color: var(--ok);
}
.g-check svg { width: 56px; height: 56px; }

.g-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--surface);
  font-size: 15px;
  color: var(--text-2);
}
.g-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 25%, transparent); }
.g-dot.is-warn { background: var(--warn); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 25%, transparent); }
