:root {
  --bg-color:    #0B0F14;
  --bg-grad-1:   #0F1A24;
  --bg-grad-2:   #0A0E13;
  --card-bg:     #111922;
  --card-bg-2:   #0E141B;
  --card-border: #1E2A36;
  --card-border-2:#172230;
  --text-main:   #C8D3DD;
  --text-title:  #FFFFFF;
  --text-dimmed: #6F7B86;
  --primary:     #2DD4BF;   /* teal */
  --primary-2:   #14B8A6;
  --cyan:        #22D3EE;
  --green:       #20C997;
  --red:         #F87171;
  --yellow:      #FBBF24;
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(ellipse at top, rgba(45,212,191,0.07), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(34,211,238,0.05), transparent 60%),
    linear-gradient(180deg, var(--bg-grad-1) 0%, var(--bg-grad-2) 100%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

@media (min-width: 768px) {
  .container { padding: 3rem 1rem 4rem; }
}

/* ============ Header ============ */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.header h4 {
  margin: 0;
  color: var(--text-title);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.header-brand {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.brand-shield {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(45,212,191,0.32);
  background: rgba(45,212,191,0.08);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.38rem 0.65rem;
}
.support-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--primary);
  transition: all 0.2s ease;
}
.support-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45,212,191,0.15);
}

/* ============ Card ============ */
.card {
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--card-border);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

/* ============ User card ============ */
.user-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.user-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(32,201,151,0.18), rgba(32,201,151,0.05));
  border: 1px solid rgba(32,201,151,0.35);
  color: var(--green);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-icon.inactive {
  background: linear-gradient(135deg, rgba(248,113,113,0.18), rgba(248,113,113,0.05));
  border-color: rgba(248,113,113,0.35);
  color: var(--red);
}
.user-details p { margin: 0; }
.user-name {
  font-weight: 700;
  color: var(--text-title);
  font-size: 1.1rem;
}
.user-expires {
  font-size: 0.85rem;
  color: var(--text-dimmed);
}

/* ============ Section header ============ */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}
.section-header h4 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--text-title);
  font-weight: 700;
}
.os-select {
  background: var(--card-bg-2);
  border: 1px solid var(--card-border);
  color: var(--text-title);
  padding: 0.55rem 2.5rem 0.55rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236F7B86' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6l6 -6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  transition: border-color 0.2s;
}
.os-select:hover { border-color: var(--primary); }

/* ============ Apps grid ============ */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.app-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--card-bg-2);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
  color: var(--text-main);
  position: relative;
  overflow: hidden;
}
.app-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(45,212,191,0.18), transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.app-card:hover { border-color: rgba(45,212,191,0.4); }
.app-card.active {
  border-color: var(--primary);
  background: linear-gradient(180deg, rgba(45,212,191,0.10), rgba(45,212,191,0.02));
  box-shadow: 0 0 0 1px rgba(45,212,191,0.35), 0 8px 24px rgba(45,212,191,0.12);
}
.app-card.active::before { opacity: 1; }
.app-card.active::after {
  content: "";
  position: absolute;
  top: 8px; left: 8px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 8px var(--yellow);
}
.app-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: rgba(45,212,191,0.10);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.app-icon svg { width: 22px; height: 22px; }
.app-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.app-name {
  font-weight: 700;
  color: var(--text-title);
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-sub {
  font-size: 0.75rem;
  color: var(--text-dimmed);
}

/* ============ Block (install / sub / steps) ============ */
.block {
  display: flex;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: 12px;
  background: var(--card-bg-2);
  border: 1px solid var(--card-border-2);
  margin-bottom: 0.85rem;
}
.block:last-child { margin-bottom: 0; }
.block-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(45,212,191,0.10);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.block-icon.ok {
  background: rgba(32,201,151,0.12);
  color: var(--green);
}
.block-icon.game {
  background: rgba(251,191,36,0.12);
  color: var(--yellow);
}
.games-block {
  border-color: rgba(251,191,36,0.22);
  background:
    linear-gradient(180deg, rgba(251,191,36,0.06), rgba(14,20,27,0.94)),
    var(--card-bg-2);
}
.block-body { flex: 1; min-width: 0; }
.block-body h5 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  color: var(--text-title);
  font-weight: 700;
}
.block-desc {
  margin: 0 0 0.85rem 0;
  font-size: 0.85rem;
  color: var(--text-dimmed);
}

/* ============ Install links ============ */
.install-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.btn-install {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(45,212,191,0.08);
  border: 1px solid rgba(45,212,191,0.25);
  color: var(--primary);
  padding: 0.7rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s;
}
.btn-install:hover {
  background: rgba(45,212,191,0.15);
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* ============ Primary / copy ============ */
.sub-action-area {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #06121A;
  border: none;
  padding: 0.95rem 1.2rem;
  border-radius: 12px;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.18s;
  box-shadow: 0 6px 20px rgba(45,212,191,0.25);
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }

.copy-fallback {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.sub-url-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #060B11;
  padding: 0.75rem;
  border-radius: 8px;
  word-break: break-all;
  font-size: 0.78rem;
  color: var(--primary);
  border: 1px solid var(--card-border);
}
.btn-secondary-full {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-title);
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}
.btn-secondary-full:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ============ Steps ============ */
.steps-list {
  margin: 0.25rem 0 0;
  padding-left: 1.2rem;
  color: var(--text-main);
  font-size: 0.88rem;
}
.steps-list li { margin-bottom: 0.35rem; }
.steps-list li::marker { color: var(--primary); font-weight: 700; }

/* ============ Misc ============ */
.hidden { display: none !important; }

@media (max-width: 480px) {
  .apps-grid { grid-template-columns: 1fr; }
}
