* {
  box-sizing: border-box;
}

:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #555;
  --color-border: #e0e0e0;
  --color-accent: #010050;
  --color-accent-hover: #020070;
  --card-bg: #fafafa;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #000000;
    --color-text: #f0f0f0;
    --color-text-muted: #b0b0b0;
    --color-border: #333;
    --color-accent: #5a5aff;
    --color-accent-hover: #7a7aff;
    --card-bg: #111;
  }
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
}

.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
}

.site-header .logo {
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--color-text);
  text-decoration: none;
}

.site-header .logo:hover {
  color: var(--color-accent);
}

.site-header nav {
  display: flex;
  gap: 1.5rem;
}

.site-header nav a {
  color: var(--color-accent);
  text-decoration: none;
  font-size: 0.9375rem;
}

.site-header nav a:hover {
  text-decoration: underline;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.hero {
  padding: 64px 0;
}

.hero h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.hero-sub {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  margin: 0;
}

.app-showcase {
  padding: 64px 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.app-loading,
.app-empty {
  grid-column: 1 / -1;
  color: var(--color-text-muted);
}

.app-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--card-bg);
}

.app-icon {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  background: var(--color-border);
  flex-shrink: 0;
  margin-bottom: 1rem;
}

.app-info h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.375rem;
}

.app-info p {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  flex: 1;
}

.app-store-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: 6px;
  text-decoration: none;
  align-self: flex-start;
}

.app-store-badge:hover {
  background: var(--color-accent);
  color: var(--color-bg);
}

.app-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.app-card-link:hover .app-info h2 {
  color: var(--color-accent);
}

.app-card .app-store-badge {
  margin-top: auto;
}

.app-detail {
  padding: 64px 0 4rem;
}

.app-detail-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 64px;
}

.app-detail-icon {
  width: 120px;
  height: 120px;
  border-radius: 22px;
  background: var(--color-border);
  flex-shrink: 0;
  object-fit: cover;
}

.app-detail-meta h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.app-detail-meta .app-store-badge {
  margin: 0;
}

.app-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 64px;
}

.gallery-photo {
  aspect-ratio: 9 / 19;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-border);
}

.gallery-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-description {
  margin-bottom: 64px;
}

.app-description h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.app-description-body {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
}

.app-description-body p {
  margin: 0 0 1rem;
}

.app-description-body p:last-child {
  margin-bottom: 0;
}

.app-description-body ul,
.app-description-body ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

.app-description-body li {
  margin-bottom: 0.25rem;
}

.site-footer,
footer {
  margin-top: 0;
  padding: 64px 0 2rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.site-footer a,
footer a {
  color: var(--color-accent);
  text-decoration: none;
}

.site-footer a:hover,
footer a:hover {
  text-decoration: underline;
}

.site-footer ul,
footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
}

.site-footer li,
footer li {
  margin: 0;
}

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 1.5rem;
  background: var(--color-text);
  color: var(--color-bg);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
}

.cookie-banner.hidden {
  display: none;
}

.cookie-banner p {
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.cookie-banner a {
  color: var(--color-accent);
  text-decoration: none;
}

@media (prefers-color-scheme: dark) {
  .cookie-banner a {
    color: #7a7aff;
  }
}

.cookie-banner a:hover {
  text-decoration: underline;
}

.cookie-banner .actions {
  display: flex;
  gap: 0.5rem;
}

.cookie-banner button {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.cookie-banner button.accept {
  background: var(--color-accent);
  color: #fff;
}

.cookie-banner button.reject {
  background: #444;
  color: #fff;
}

.legal-page h1 {
  margin-bottom: 1rem;
}

.legal-page h2 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
}

.legal-page p {
  margin: 0 0 0.75rem;
}

.legal-page ul {
  margin: 0 0 0.75rem;
  padding-left: 1.5rem;
}

.legal-page a {
  color: var(--color-accent);
  text-decoration: none;
}

.legal-page a:hover {
  text-decoration: underline;
}

.withdrawal-form {
  max-width: 400px;
  margin: 1rem 0;
}

.withdrawal-form label {
  display: block;
  margin-top: 0.75rem;
  font-weight: 500;
}

.withdrawal-form input,
.withdrawal-form textarea {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.25rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font: inherit;
  background: var(--color-bg);
  color: var(--color-text);
}

.withdrawal-form button {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

@media (max-width: 480px) {
  .cookie-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero-sub {
    font-size: 1.0625rem;
  }

  .app-detail-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-gallery {
    grid-template-columns: 1fr;
  }
}
