:root {
  --bg: #0f1923;
  --bg-elevated: #16232f;
  --card: #1b2836;
  --border: #2a3a49;
  --text: #ece8e1;
  --text-muted: #9fb0bd;
  --accent: #ff4655;
  --accent-hover: #ff2f41;
  --radius: 10px;
  --max-width: 640px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: radial-gradient(circle at top, var(--bg-elevated), var(--bg) 60%);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: relative;
  padding: 24px 20px 0;
  text-align: center;
}

.brand {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.35em;
  color: var(--text);
}

.tagline {
  margin: 4px 0 0;
  color: var(--accent);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 20px;
  gap: 28px;
}

.hero {
  text-align: center;
  max-width: 520px;
}

.hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  margin: 0 0 10px;
}

.hero p {
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.order-card {
  width: 100%;
  max-width: var(--max-width);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 20px 45px -25px rgba(0, 0, 0, 0.6);
}

.rank-picker-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.rank-field {
  position: relative;
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rank-field label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field-arrow {
  color: var(--text-muted);
  font-size: 1.3rem;
  padding-bottom: 12px;
  flex: 0 0 auto;
}

.rank-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: left;
}

.rank-trigger:hover,
.rank-trigger[aria-expanded="true"] {
  border-color: var(--accent);
}

.rank-trigger-icon,
.rank-option img,
.rank-option .rank-badge,
.rank-trigger-icon img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex: 0 0 auto;
  object-fit: cover;
}

.rank-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #10161d;
  font-weight: 700;
  font-size: 0.7rem;
}

.rank-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.7);
  z-index: 20;
}

.rank-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  text-align: left;
}

.rank-option:hover {
  background: rgba(255, 70, 85, 0.12);
}

.form-error {
  margin: 14px 0 0;
  color: var(--accent);
  font-size: 0.85rem;
}

.al-area {
  margin-top: 20px;
  text-align: center;
}

.al-btn {
  border: none;
  border-radius: 8px;
  padding: 14px 48px;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.05s ease;
}

.al-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.al-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.al-btn:disabled {
  background: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
}

.al-note {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.platform-note {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
  max-width: var(--max-width);
}

footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 20px;
}

@media (max-width: 480px) {
  .order-card {
    padding: 20px;
  }

  .field-arrow {
    display: none;
  }
}

/* A trigger/panel's own layout rules (flex/absolute) would otherwise beat the
   browser's default [hidden] { display: none } - that default only has
   attribute-selector specificity. Re-assert it here so toggling .hidden via
   JS always actually hides the element. */
[hidden] {
  display: none !important;
}
