/* White Duke — whduke.fun */

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, Roboto, sans-serif;
  background: #0a0e1a;
  color: #fff;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}
.hidden { display: none !important; }
a { color: #54a9eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── AUTH ─────────────────────────────────────────────────────────────── */
.auth-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 20% 0%, #1a2447 0%, transparent 50%),
    radial-gradient(circle at 80% 100%, #2a1f47 0%, transparent 50%),
    #0a0e1a;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: rgba(20, 26, 48, .65);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 22px;
  padding: 28px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.auth-brand {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  margin-bottom: 28px;
}
.auth-logo-wrap {
  position: relative;
  width: 168px; height: 168px;
  display: flex; align-items: center; justify-content: center;
  animation: logoIntro 1s cubic-bezier(.34,1.56,.64,1) both,
             logoFloat 5s ease-in-out 1s infinite;
  perspective: 600px;
}
/* большой пульсирующий ореол — внешний слой */
.auth-logo-wrap::before {
  content: "";
  position: absolute; inset: -40%;
  background:
    radial-gradient(circle, rgba(120,170,235,.55) 0%, rgba(120,170,235,.15) 30%, transparent 65%);
  filter: blur(14px);
  animation: logoGlow 2.6s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
/* вращающееся «солнце» из лучей за короной */
.auth-logo-wrap::after {
  content: "";
  position: absolute; inset: -20%;
  background:
    conic-gradient(from 0deg,
      transparent 0deg, rgba(180,210,255,.22) 22deg, transparent 45deg,
      transparent 90deg, rgba(180,210,255,.22) 112deg, transparent 135deg,
      transparent 180deg, rgba(180,210,255,.22) 202deg, transparent 225deg,
      transparent 270deg, rgba(180,210,255,.22) 292deg, transparent 315deg);
  filter: blur(6px);
  border-radius: 50%;
  animation: logoSpin 12s linear infinite;
  pointer-events: none;
  z-index: 0;
  opacity: .8;
}
.auth-logo {
  position: relative; z-index: 1;
  width: 140px; height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 14px 32px rgba(180,210,255,.5));
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);
  animation: logoSway 4s ease-in-out infinite;
}
.auth-logo-wrap:hover .auth-logo {
  transform: scale(1.08) rotate(-4deg);
}
.auth-title {
  font-size: 28px; font-weight: 800; letter-spacing: -0.02em;
  background: linear-gradient(180deg, #fff 0%, #b0b6c4 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Анимации */
@keyframes logoIntro {
  0%   { opacity: 0; transform: scale(.4) rotate(-25deg); }
  60%  { opacity: 1; transform: scale(1.15) rotate(8deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
@keyframes logoSway {
  0%, 100% { transform: rotate(-3deg); }
  50%      { transform: rotate(3deg); }
}
@keyframes logoGlow {
  0%, 100% { opacity: .45; transform: scale(.85); }
  50%      { opacity: 1;   transform: scale(1.2); }
}
@keyframes logoSpin {
  to { transform: rotate(360deg); }
}

.auth-tabs {
  display: flex; gap: 6px; padding: 4px;
  background: rgba(0,0,0,.25);
  border-radius: 12px;
  margin-bottom: 22px;
}
.auth-tab {
  flex: 1; padding: 10px 14px;
  background: transparent; border: none; color: #b0b6c4;
  font-family: inherit; font-size: 14px; font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.auth-tab.active { background: #54a9eb; color: #fff; }

.auth-form { display: none; flex-direction: column; gap: 14px; }
.auth-form.active { display: flex; }

.auth-form label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; color: #9aa1b2; font-weight: 500;
}
.auth-form input {
  padding: 13px 14px;
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  color: #fff;
  font-family: inherit; font-size: 16px;
  transition: border-color .15s, background .15s;
}
.auth-form input:focus {
  outline: none;
  border-color: #54a9eb;
  background: rgba(0,0,0,.45);
}

.auth-step {
  display: flex; gap: 12px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(84,169,235,.08), rgba(84,169,235,.02));
  border: 1px solid rgba(84,169,235,.2);
  border-radius: 12px;
  font-size: 13.5px; line-height: 1.5;
  color: #cdd3e2;
}
.auth-step-num {
  flex: 0 0 28px; width: 28px; height: 28px;
  background: #54a9eb; color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.auth-step code {
  background: rgba(255,255,255,.08); padding: 2px 6px; border-radius: 5px;
  font-family: ui-monospace, monospace; font-size: 13px;
}

.auth-submit {
  margin-top: 4px;
  padding: 14px;
  background: linear-gradient(180deg, #54a9eb 0%, #3a96d9 100%);
  color: #fff; border: none; border-radius: 12px;
  font-family: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(58,150,217,.35);
  transition: transform .1s, filter .15s;
}
.auth-submit:hover { filter: brightness(1.08); }
.auth-submit:active { transform: translateY(1px) scale(.99); }
.auth-submit:disabled { opacity: .5; cursor: wait; }

.auth-error {
  color: #ff6b78;
  font-size: 13px;
  min-height: 18px;
  text-align: center;
}
.auth-hint {
  margin: 4px 0 0; text-align: center;
  font-size: 13.5px; color: #9aa1b2;
}

/* ─── APP ──────────────────────────────────────────────────────────────── */
.app-screen {
  max-width: 560px; margin: 0 auto;
  padding: 0 16px 60px;
  min-height: 100vh;
}

.app-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 4px 14px;
  background: linear-gradient(180deg, #0a0e1a 0%, rgba(10,14,26,.95) 70%, transparent 100%);
  backdrop-filter: blur(10px);
}
.app-brand { display: flex; align-items: center; gap: 12px; }
.app-logo-mini {
  position: relative;
  width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center;
}
.app-logo-mini::before {
  content: "";
  position: absolute; inset: -25%;
  background: radial-gradient(circle, rgba(120,170,235,.45) 0%, transparent 65%);
  filter: blur(8px);
  animation: appLogoGlow 2.8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.app-logo {
  position: relative; z-index: 1;
  width: 50px; height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(180,200,230,.45));
  animation: appLogoSway 3.6s ease-in-out infinite;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.app-logo:hover { transform: scale(1.1) rotate(-5deg); animation-play-state: paused; }
@keyframes appLogoSway {
  0%, 100% { transform: rotate(-2.5deg) translateY(0); }
  50%      { transform: rotate(2.5deg)  translateY(-3px); }
}
@keyframes appLogoGlow {
  0%, 100% { opacity: .45; transform: scale(.85); }
  50%      { opacity: 1;   transform: scale(1.15); }
}
.app-brand-name {
  font-size: 20px; font-weight: 700; letter-spacing: -0.01em;
  background: linear-gradient(180deg, #fff 0%, #b0b6c4 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.app-menu-btn {
  width: 38px; height: 38px; border-radius: 12px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  color: #b0b6c4;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.app-menu-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

.app-menu {
  position: absolute; top: 60px; right: 4px;
  min-width: 220px;
  background: rgba(20, 26, 48, .92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 6px;
  z-index: 31;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.menu-item {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: 11px 14px;
  background: transparent; border: none; text-align: left;
  color: #fff; font-family: inherit; font-size: 14.5px;
  cursor: pointer;
  border-radius: 10px;
  transition: background .15s;
  text-decoration: none;
}
.menu-item:hover { background: rgba(255,255,255,.06); }
.menu-icon { color: #b0b6c4; }
.menu-danger { color: #ff6b78; }
.menu-danger .menu-icon { color: #ff6b78; }

/* Hero */
.hero {
  text-align: center;
  padding: 28px 16px 24px;
}
.hero-status {
  font-size: 14px; color: #9aa1b2; margin: 0 0 8px;
}
.hero-days {
  font-size: 56px; font-weight: 800; letter-spacing: -0.03em;
  background: linear-gradient(180deg, #fff 0%, #b0b6c4 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.hero-days.danger {
  background: linear-gradient(180deg, #ff6b78 0%, #ff375f 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-days-suffix { font-size: 22px; font-weight: 600; color: #b0b6c4; margin-left: 6px; }
.hero-sub { font-size: 14px; color: #9aa1b2; margin: 12px 0 18px; }
.hero-action {
  display: inline-block;
  padding: 14px 32px;
  background: linear-gradient(180deg, #54a9eb 0%, #3a96d9 100%);
  color: #fff; border: none; border-radius: 14px;
  font-family: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(58,150,217,.4);
  transition: transform .1s, filter .15s;
}
.hero-action:hover { filter: brightness(1.08); }
.hero-action:active { transform: translateY(1px) scale(.99); }

/* Quick grid */
.quick-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin: 4px 0 24px;
}
.quick-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  color: #fff;
  font-family: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.quick-card:hover { background: rgba(255,255,255,.07); }
.quick-card:active { transform: scale(.97); }
.quick-icon { font-size: 24px; }
.quick-label { color: #cdd3e2; }

/* Block */
.block {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
}
.block-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.block-head h3 {
  margin: 0; font-size: 15px; font-weight: 600; color: #fff;
}
.btn-ghost {
  background: transparent; border: 1px solid rgba(84,169,235,.3);
  color: #54a9eb; font-family: inherit; font-size: 13px; font-weight: 500;
  padding: 7px 12px; border-radius: 9px; cursor: pointer;
  transition: background .15s;
}
.btn-ghost:hover { background: rgba(84,169,235,.1); }

/* Devices */
.devices-list { display: flex; flex-direction: column; gap: 8px; }
.device-skel { color: #6e7588; padding: 12px; text-align: center; font-size: 13px; }
.device-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: rgba(255,255,255,.04);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.05);
  cursor: pointer;
  transition: background .15s;
}
.device-row:hover { background: rgba(255,255,255,.07); }
.device-icon { font-size: 22px; }
.device-name { flex: 1; font-weight: 500; }
.device-arrow { color: #6e7588; }

.empty-block {
  text-align: center; padding: 22px 12px;
  color: #6e7588; font-size: 14px;
}

/* Plans */
.plans-list { display: flex; flex-direction: column; gap: 8px; }
.plan-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.plan-card:hover { background: rgba(255,255,255,.07); border-color: rgba(84,169,235,.4); }
.plan-name { font-weight: 600; }
.plan-disc { color: #34c759; font-size: 12px; margin-left: 8px; }
.plan-price { color: #54a9eb; font-weight: 700; font-size: 15px; }

/* Referral */
.referral-block { text-align: center; }
.referral-emoji { font-size: 38px; margin: 4px 0 6px; }
.referral-title { font-size: 22px; font-weight: 700; margin: 0 0 8px; line-height: 1.25; }
.referral-sub { color: #9aa1b2; font-size: 13.5px; margin: 0 0 16px; line-height: 1.5; }
.referral-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-bottom: 8px;
}
.btn-primary {
  padding: 12px;
  background: linear-gradient(180deg, #54a9eb 0%, #3a96d9 100%);
  color: #fff; border: none; border-radius: 11px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.btn-primary:active { transform: scale(.98); }
.btn-secondary {
  padding: 12px;
  background: rgba(84,169,235,.1);
  color: #54a9eb; border: 1px solid rgba(84,169,235,.3); border-radius: 11px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.btn-secondary:active { transform: scale(.98); }
.referral-stats { font-size: 12.5px; color: #6e7588; margin-top: 8px; }

/* Guides */
.guide-list { display: flex; flex-direction: column; gap: 6px; }
.guide-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: rgba(255,255,255,.04);
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,.05);
  color: #fff;
  text-decoration: none;
  transition: background .15s;
}
.guide-item:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.guide-icon { font-size: 18px; }
.guide-item span:nth-child(2) { flex: 1; font-size: 14.5px; }
.guide-arrow { color: #6e7588; font-size: 18px; }

/* Footer */
.app-footer {
  text-align: center; padding: 24px 0 8px;
  color: #4a5165; font-size: 12px;
}

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 100;
  opacity: 0;
  transition: opacity .25s;
}
.modal-overlay.open { opacity: 1; }
.modal {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(.95);
  width: calc(100% - 24px); max-width: 460px;
  max-height: 86vh;
  overflow: auto;
  background: #14182a;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  z-index: 101;
  padding: 20px;
  opacity: 0;
  transition: opacity .25s, transform .25s;
}
.modal.open { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.modal h2 { margin: 0 0 14px; font-size: 19px; }
.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,.06); border: none; color: #b0b6c4;
  font-size: 20px; cursor: pointer;
}

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20,26,48,.95);
  border: 1px solid rgba(255,255,255,.1);
  color: #fff;
  padding: 12px 18px;
  border-radius: 11px;
  font-size: 14px;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  z-index: 200;
  max-width: 90vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
