/* ===== Flappy Bird CSS — hand-written, not generated ===== */

:root {
  --primary: #F5A623;
  --secondary: #E8C547;
  --accent: #FF6B35;
  --bg-dark: #1A1A2E;
  --bg-light: #FDF6E3;
  --card-light: #FFFFFF;
  --card-dark: #16213E;
  --border: rgba(245,166,35,0.2);
  --text-light: #2D3436;
  --text-dark: #FDF6E3;
}

/* theme handling */
[data-theme="dark"] {
  --bg: var(--bg-dark);
  --card: var(--card-dark);
  --text: var(--text-dark);
  --text-muted: rgba(253,246,227,0.65);
  --nav-bg: rgba(22,33,62,0.95);
  --input-bg: rgba(253,246,227,0.05);
}

[data-theme="light"] {
  --bg: var(--bg-light);
  --card: var(--card-light);
  --text: var(--text-light);
  --text-muted: rgba(45,52,54,0.65);
  --nav-bg: rgba(253,246,227,0.95);
  --input-bg: rgba(45,52,54,0.05);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
}

.brand img { width: 32px; height: 32px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--primary);
  transition: width 0.2s;
}

.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* language dropdown */
.lang-dropdown {
  position: relative;
}

.lang-btn {
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.2s;
}

.lang-btn:hover { border-color: var(--primary); }

.lang-btn .arrow {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--text);
  margin-top: 2px;
}

.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  overflow: hidden;
  padding: 4px 0;
}

.lang-dropdown.open .lang-menu { display: block; }

.lang-menu a {
  display: block;
  padding: 8px 16px;
  color: var(--text);
  font-size: 0.88rem;
  transition: background 0.15s;
}

.lang-menu a:hover { background: var(--input-bg); }

.lang-menu a.current {
  color: var(--primary);
  font-weight: 600;
}

/* theme toggle */
.theme-toggle {
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px; height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
}

.theme-toggle:hover { border-color: var(--primary); }

/* hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: 0.3s;
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ===== Main ===== */
main { padding-top: 64px; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* hero */
.hero {
  text-align: center;
  padding: 60px 20px 40px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 32px;
}

/* game section */
.game-section {
  padding: 20px 20px 60px;
  display: flex;
  justify-content: center;
}

.game-wrapper {
  width: 100%;
  max-width: 480px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  background: #70c5ce;
  position: relative;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
  touch-action: none;
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
}

.game-overlay.hidden { display: none; }

.game-overlay .score-display {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
  z-index: 6;
}

.game-overlay .center-text {
  text-align: center;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
}

.game-overlay .center-text h2 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.game-overlay .center-text p {
  font-size: 1rem;
  margin-bottom: 16px;
}

.game-overlay .center-text .best-score {
  font-size: 1.1rem;
  color: var(--secondary);
}

.game-overlay .restart-btn {
  pointer-events: auto;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 28px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  text-shadow: none;
}

.game-overlay .restart-btn:hover { background: var(--accent); }

/* highlights */
.highlights {
  padding: 40px 20px;
}

.highlights h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 32px;
}

.highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.highlight-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.highlight-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(245,166,35,0.12);
}

.highlight-card .icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.highlight-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--primary);
}

.highlight-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* FAQ */
.faq-section {
  padding: 40px 20px 60px;
}

.faq-section h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 32px;
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-q {
  padding: 18px 24px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.98rem;
}

.faq-q .plus {
  font-size: 1.3rem;
  color: var(--primary);
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: 12px;
}

.faq-item.open .plus { transform: rotate(45deg); }

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 24px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.faq-item.open .faq-a {
  max-height: 300px;
  padding: 0 24px 18px;
}

/* about section */
.about-section {
  padding: 40px 20px 60px;
  text-align: center;
}

.about-section h2 {
  font-size: 2rem;
  margin-bottom: 20px;
}

.about-section p {
  max-width: 600px;
  margin: 0 auto 12px;
  color: var(--text-muted);
}

/* cookie notice */
.cookie-notice {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 200;
  transform: translateY(100%);
  transition: transform 0.3s;
}

.cookie-notice.show { transform: translateY(0); }

.cookie-notice p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.cookie-notice button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 6px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
}

.cookie-notice button:hover { background: var(--accent); }

/* ===== Footer ===== */
.site-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 40px 20px 24px;
  margin-top: 40px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-brand {
  flex: 1;
  min-width: 200px;
}

.footer-brand .brand { margin-bottom: 8px; }

.footer-brand p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-links a:hover { color: var(--primary); }

.footer-bottom {
  max-width: 1200px;
  margin: 24px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--nav-bg);
    flex-direction: column;
    padding: 20px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.show {
    display: flex;
  }

  .hamburger { display: block; }

  .hero { padding: 40px 20px 30px; }

  .footer-content {
    flex-direction: column;
  }
}
