* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  background: linear-gradient(145deg, #0f0f12 0%, #1a1a25 50%, #0d0d10 100%);
  color: #e8e6e3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.header {
  text-align: center;
  margin-bottom: 3rem;
}

.header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #f4c23b 0%, #e8a838 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header p {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: #8b8a87;
  font-weight: 500;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  max-width: 380px;
}

.menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
  padding: 1.15rem 1.15rem;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  color: #e8e6e3;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.menu-btn[type="button"] {
  text-align: center;
  appearance: none;
}

.menu-buttons > .menu-btn {
  width: 100%;
}

.menu-btn-row .menu-btn[type="button"] {
  width: auto;
}

.menu-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(244, 194, 59, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(244, 194, 59, 0.08);
}

.menu-btn:active {
  transform: translateY(0);
}

.menu-btn.continent {
  border-left: 4px solid #5b9bd5;
}

.menu-btn.randomized {
  border-left: 4px solid #7ab87a;
}

.menu-btn.checklist-link {
  border-left: 4px solid #e8a838;
}

.menu-btn.checklist-link:hover {
  border-left-color: #f4c23b;
}

.menu-btn-row {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

.menu-btn-row .menu-btn {
  flex: 1;
}

.menu-btn.settings-link {
  border-left: 4px solid #8b8a87;
}

.menu-btn.settings-link:hover {
  border-left-color: #f4c23b;
}

.menu-btn.how-to-use {
  border-left: 4px solid #7ab87a;
}

.menu-btn.how-to-use:hover {
  border-left-color: #f4c23b;
}

.menu-btn .icon {
  font-size: 1.35rem;
  opacity: 0.9;
}

.settings {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.setting-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #8b8a87;
  user-select: none;
}

.setting-toggle input {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #8b8a87;
  border-radius: 50%;
  transition: transform 0.2s ease, background 0.2s ease;
}

.setting-toggle input:checked + .toggle-slider {
  background: rgba(244, 194, 59, 0.2);
  border-color: rgba(244, 194, 59, 0.4);
}

.setting-toggle input:checked + .toggle-slider::after {
  transform: translateX(20px);
  background: #f4c23b;
}

.toggle-label {
  font-weight: 500;
}

.trophy-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
  max-width: 380px;
}

.trophy-title {
  font-size: 1rem;
  font-weight: 600;
  color: #8b8a87;
  margin-bottom: 0.75rem;
}

.reset-trophies-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 1rem;
}

.reset-trophies-btn {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: #8b8a87;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.reset-trophies-btn:hover {
  color: #c47b7b;
  border-color: rgba(196, 123, 123, 0.3);
  background: rgba(196, 123, 123, 0.08);
}

.trophy-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.trophy-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  color: #8b8a87;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.trophy-item.unlocked {
  color: #e8e6e3;
  border-color: rgba(244, 194, 59, 0.2);
  background: rgba(244, 194, 59, 0.06);
}

.trophy-item.locked .trophy-icon {
  opacity: 0.4;
}

.trophy-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* Login overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 1002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  animation: how-to-overlay-in 0.3s ease-out;
}

.login-overlay[hidden] {
  display: none;
}

.login-modal {
  background: linear-gradient(145deg, #1a1a25 0%, #0f0f12 100%);
  border: 1px solid rgba(244, 194, 59, 0.3);
  border-radius: 20px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  animation: how-to-modal-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.login-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.login-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #e8e6e3;
  background: linear-gradient(135deg, #f4c23b 0%, #e8a838 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  color: #8b8a87;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.login-close:hover {
  color: #e8e6e3;
  background: rgba(255, 255, 255, 0.08);
}

.login-content {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-desc {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #8b8a87;
  margin: 0;
}

.login-content .account-tabs {
  display: flex;
  gap: 0.5rem;
}

.login-content .account-tab {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #8b8a87;
  cursor: pointer;
  transition: all 0.2s ease;
}

.login-content .account-tab:hover {
  color: #e8e6e3;
  border-color: rgba(255, 255, 255, 0.25);
}

.login-content .account-tab.active {
  color: #f4c23b;
  border-color: rgba(244, 194, 59, 0.5);
  background: rgba(244, 194, 59, 0.08);
}

.login-content .account-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-content .account-form input {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #e8e6e3;
  outline: none;
}

.login-content .account-form input::placeholder {
  color: #6b6a67;
}

.login-content .account-form input:focus {
  border-color: rgba(244, 194, 59, 0.4);
}

.login-content .account-error {
  font-size: 0.9rem;
  color: #e07c7c;
  margin: 0;
}

.login-content .account-submit-btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  color: #1a1a1a;
  background: #f4c23b;
  border: 1px solid #f4c23b;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.login-content .account-submit-btn:hover {
  background: #f5cd4d;
  border-color: #f5cd4d;
}

.login-content .account-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-skip-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.login-skip-btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.6rem 1rem;
  color: #8b8a87;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.login-skip-btn:hover {
  color: #e8e6e3;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.login-skip-note {
  font-size: 0.8rem;
  color: #6b6a67;
  margin: 0;
  font-style: italic;
}

/* Quickstart overlay */
.quickstart-overlay {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  animation: how-to-overlay-in 0.3s ease-out;
}

.quickstart-overlay[hidden] {
  display: none;
}

.quickstart-modal {
  background: linear-gradient(145deg, #1a1a25 0%, #0f0f12 100%);
  border: 1px solid rgba(91, 155, 213, 0.4);
  border-radius: 20px;
  max-width: 400px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  animation: how-to-modal-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quickstart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.quickstart-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #e8e6e3;
  background: linear-gradient(135deg, #5b9bd5 0%, #7ab87a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.quickstart-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  color: #8b8a87;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.quickstart-close:hover {
  color: #e8e6e3;
  background: rgba(255, 255, 255, 0.08);
}

.quickstart-content {
  padding: 1.25rem 1.5rem;
}

.quickstart-content p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #c4c2bf;
  margin-bottom: 0.75rem;
}

.quickstart-content p:last-child {
  margin-bottom: 0;
}

.quickstart-content strong {
  color: #e8e6e3;
}

.quickstart-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0 1.5rem 1.5rem;
}

.quickstart-primary {
  display: block;
  text-align: center;
  padding: 0.875rem 1.5rem;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f0f12;
  background: linear-gradient(135deg, #5b9bd5 0%, #4a8bc4 100%);
  border: none;
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quickstart-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(91, 155, 213, 0.4);
}

.quickstart-secondary {
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: #8b8a87;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.quickstart-secondary:hover {
  color: #e8e6e3;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

/* How to use overlay */
.how-to-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  animation: how-to-overlay-in 0.3s ease-out;
}

.how-to-overlay[hidden] {
  display: none;
}

@keyframes how-to-overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.how-to-modal {
  background: linear-gradient(145deg, #1a1a25 0%, #0f0f12 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  animation: how-to-modal-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes how-to-modal-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.how-to-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.how-to-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #e8e6e3;
  background: linear-gradient(135deg, #f4c23b 0%, #e8a838 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.how-to-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  line-height: 1;
  color: #8b8a87;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.how-to-close:hover {
  color: #e8e6e3;
  background: rgba(255, 255, 255, 0.08);
}

.how-to-content {
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  flex: 1;
}

.how-to-content section {
  margin-bottom: 1.5rem;
}

.how-to-content section:last-child {
  margin-bottom: 0;
}

.how-to-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #f4c23b;
  margin-bottom: 0.5rem;
}

.how-to-content p,
.how-to-content li {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #c4c2bf;
  margin-bottom: 0.5rem;
}

.how-to-content ul,
.how-to-content ol {
  margin: 0.5rem 0 1rem 1.25rem;
  padding: 0;
}

.how-to-content li {
  margin-bottom: 0.4rem;
}

.how-to-content strong {
  color: #e8e6e3;
}

.how-to-dismiss {
  margin: 0 1.5rem 1.5rem;
  padding: 0.875rem 2rem;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f0f12;
  background: linear-gradient(135deg, #f4c23b 0%, #e8a838 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.how-to-dismiss:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(244, 194, 59, 0.4);
}

/* Responsive: tablet and below */
@media (max-width: 768px) {
  body {
    padding: 1.5rem 1rem;
  }

  .header {
    margin-bottom: 2rem;
  }

  .header h1 {
    font-size: 1.65rem;
  }

  .trophy-list {
    grid-template-columns: 1fr 1fr;
  }

  .quickstart-overlay,
  .how-to-overlay {
    padding: 1rem;
  }

  .quickstart-modal {
    max-width: 100%;
  }

  .quickstart-header,
  .quickstart-content {
    padding: 1rem 1.25rem;
  }

  .quickstart-actions {
    padding: 0 1.25rem 1.25rem;
  }

  .how-to-modal {
    max-width: 100%;
    max-height: 85vh;
  }

  .how-to-header {
    padding: 1.25rem 1.25rem 0.5rem;
  }

  .how-to-header h2 {
    font-size: 1.2rem;
  }

  .how-to-content {
    padding: 1rem 1.25rem;
  }

  .how-to-content p,
  .how-to-content li {
    font-size: 0.9rem;
  }

  .how-to-dismiss {
    margin: 0 1.25rem 1.25rem;
  }
}

/* Responsive: small mobile */
@media (max-width: 480px) {
  body {
    padding: 1rem 0.75rem;
  }

  .header h1 {
    font-size: 1.45rem;
  }

  .header p {
    font-size: 0.9rem;
  }

  .menu-btn {
    padding: 1rem 1rem;
    font-size: 1rem;
  }

  .trophy-list {
    grid-template-columns: 1fr;
  }

  .trophy-item {
    padding: 0.5rem 0.875rem;
    font-size: 0.85rem;
  }

  .menu-btn-row {
    flex-direction: column;
  }

  .menu-btn-row .menu-btn {
    width: 100%;
  }
}
