:root {
  --bg: #1a1a1a;
  --surface: #232323;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --soft: rgba(255, 255, 255, 0.46);
  --mc-red: #eb001b;
  --mc-orange: #ff5f00;
  --mc-yellow: #f79e1b;
  --danger: #ff9f9f;
  --shadow-lg: 0 22px 60px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left,  rgba(235, 0,   27,  0.16), transparent 24%),
    radial-gradient(circle at bottom right, rgba(247, 158, 27, 0.11), transparent 26%),
    linear-gradient(180deg, #1a1a1a 0%, #131313 100%);
  background-color: #161616;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

img { display: block; max-width: 100%; }

button, input, svg { font: inherit; }

button:focus, button:focus-visible,
input:focus,  input:focus-visible,
svg:focus,    svg:focus-visible {
  outline: none;
  box-shadow: none;
}

/* ── Shell ── */
.page-shell {
  min-height: 100vh;
  padding: 32px 20px 48px;
}

.app-card {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

/* ── Topbar ── */
.topbar {
  text-align: center;
  padding: 0;
}

.topbar-inner {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.topbar-logo {
  width: 60px;
}

.topbar-title {
  font-size: clamp(1rem, 2.8vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.45);
}


.dial-section {
  padding: 0;
  margin-bottom: 0;
}

.dial-info {
  text-align: center;
  margin: 6px 0 20px;
}

.dial-title {
  font-size: clamp(1.8rem, 5.5vw, 2.2rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 20px 0 4px;
}

.dial-title em {
  font-style: normal;
  color: var(--mc-yellow);
  -webkit-text-fill-color: var(--mc-yellow);
}

.dial-shell {
  display: flex;
  justify-content: center;
}

.dial-square {
  width: min(100%, 300px);
  aspect-ratio: 1 / 1;
  position: relative;
}

.minute-dial {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  cursor: grab;
}

.minute-dial.is-dragging { cursor: grabbing; }

#minuteDial { outline: none; }

.dial-hit-ring {
  fill: none;
  stroke: transparent;
  stroke-width: 60px;
  pointer-events: none;
}

.dial-track,
.dial-past-arc,
.dial-progress-arc,
.dial-center-group { pointer-events: none; }

.dial-handle-glow,
.dial-handle { pointer-events: auto; }

#handleTouchTarget { pointer-events: auto; }

#handle,
#handleGlowCircle,
#handleTouchTarget { touch-action: none; }

body.is-touch-dragging {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

.dial-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.09);
  stroke-width: 44px;
}

.dial-past-arc {
  fill: none;
  stroke: gray;
  stroke-width: 8px;
  stroke-dasharray: 10 34;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 200px 200px;
  opacity: 0.55;
}

.dial-progress-arc {
  fill: none;
  stroke: url(#mcGradient);
  stroke-width: 34px;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 200px 200px;
  transition: stroke-dashoffset 60ms linear, opacity 220ms ease;
}

.dial-handle-glow {
  fill: var(--mc-red);
  opacity: 0.9;
  transition: cx 50ms linear, cy 50ms linear, opacity 220ms ease;
}

.dial-handle {
  fill: white;
  stroke: black;
  stroke-width: 5;
  transition: cx 50ms linear, cy 50ms linear;
}

.dial-center-disc { fill: #1d1d1f; }

.dial-ticks { pointer-events: none; }

.dial-tick {
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.dial-tick--major {
  stroke: rgba(255, 255, 255, 0.38);
  stroke-width: 2;
}

.dial-center-group { transform-origin: 200px 200px; }

.dial-center-group.is-pulsing {
  animation: centerPulse 220ms ease;
}

.dial-minute-text {
  fill: #ffffff;
  font-size: 94px;
  font-weight: 900;
  letter-spacing: -0.02em;
  dominant-baseline: middle;
}

.dial-minute-label {
  fill: var(--mc-red);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.75;
}

.dial-section.is-locked .dial-progress-arc,
.dial-section.is-locked .dial-handle-glow {
  animation: breathe 2.2s ease-in-out infinite;
}

/* ── Handle ripple ── */
@keyframes rippleOut {
  0%   { r: 13; opacity: 0.8; stroke-width: 3; }
  100% { r: 36; opacity: 0;   stroke-width: 1; }
}
.handle-ripple.is-pulsing {
  animation: rippleOut 0.5s ease-out forwards;
}

/* ── Form ── */
.details-reveal { padding: 0; }
.details-reveal.is-visible { opacity: 1; }

.details-panel-form {
  padding: 24px 0 0;
}

.fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.field-group {
  display: grid;
  gap: 7px;
}

.field-label {
  padding-left: 15px;
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-input {
  width: 100%;
  min-height: 54px;
  padding: 14px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(#181818, #181818) padding-box,
    linear-gradient(
      to right,
      rgba(235, 0, 27, 0.7) 0%,
      rgba(235, 0, 27, 0.15) 8%,
      rgba(255, 255, 255, 0.08) 50%,
      rgba(255, 255, 255, 0.08) 100%
    ) border-box;
  background-color: rgba(255, 255, 255, 0.04);
  color: #fff;
  outline: none;
  transition: box-shadow 0.18s ease, background 0.18s ease;
}

.field-input::placeholder { color: rgba(255, 255, 255, 0.28); }

.field-input:focus {
  box-shadow: 0 0 0 3px rgba(235, 0, 27, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.field-error {
  margin: 0;
  color: #ff9f9f;
  font-size: 0.78rem;
  line-height: 1.35;
  min-height: 0;
}

.success-text {
  margin: 8px 2px 0;
  color: #8ff0b0;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.4;
  min-height: 0;
}

/* ── Button ── */
.lock-btn {
  width: 100%;
  min-height: 60px;
  border: 0;
  border-radius: 999px;
  margin-top: 5px;
  background: linear-gradient(135deg, var(--mc-red), var(--mc-orange));
  color: #fff;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 0.04em;
  box-shadow: 0 12px 32px rgba(235, 0, 27, 0.32);
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease, filter 0.2s ease;
}

.lock-btn:hover:not(:disabled) { filter: brightness(1.08); }
.lock-btn:active:not(:disabled) { transform: translateY(1px); }
.lock-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

/* ── Keyframes ── */
@keyframes centerPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes breathe {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.58; }
}

/* ── Entrance animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes scalePop {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

.topbar         { animation: fadeUp   0.45s ease both; animation-delay: 0.05s; }
.dial-section   { animation: fadeUp   0.45s ease both; animation-delay: 0.25s; }
.details-reveal { animation: fadeUp   0.45s ease both; animation-delay: 0.35s; }
.lock-btn       { animation: scalePop 0.4s  ease both; animation-delay: 0.42s; }

/* ── Success overlay ── */
.success-overlay {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 20px 32px;
}
.success-overlay.is-visible {
  display: flex;
  animation: fadeUp 0.5s ease both;
}
.success-icon {
  width: 68px;
  height: 68px;
  margin-bottom: 22px;
  filter: drop-shadow(0 0 16px rgba(235, 137, 0, 0.4));
}
.success-icon svg { width: 100%; height: 100%; }
#successCheck {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  transition: stroke-dashoffset 0.5s ease 0.2s;
}
.success-overlay.is-visible #successCheck { stroke-dashoffset: 0; }
.success-heading {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 5vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--mc-red), var(--mc-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.success-body {
  margin: 0 0 8px;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.5;
}
.success-body strong { color: #fff; font-weight: 900; }
.success-sub {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 500;
}
.success-sub em { font-style: italic; color: rgba(255, 255, 255, 0.55); }

/* ── Responsive ── */
@media (min-width: 640px) {
  .page-shell { padding: 44px 28px 56px; }
}

.field-group--full {
  margin-top: 12px;
}

