/* ================================================================
   mayintarlasi.net — main.css v4
   Modern Flat UI · CSS Custom Properties · Mobile-first
   ================================================================ */

/* ── Google Fonts (Inter) ──────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@700&display=swap');

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  /* Brand */
  --c-primary:       #6366f1;
  --c-primary-dark:  #4f46e5;
  --c-primary-light: #e0e7ff;
  --c-accent:        #8b5cf6;
  --c-success:       #10b981;
  --c-danger:        #ef4444;
  --c-warning:       #f59e0b;

  /* Neutrals — Light mode */
  --c-bg:            #f8fafc;
  --c-bg-card:       #ffffff;
  --c-bg-subtle:     #f1f5f9;
  --c-border:        #e2e8f0;
  --c-text:          #0f172a;
  --c-text-muted:    #64748b;
  --c-text-xmuted:   #94a3b8;

  /* Typography */
  --font-sans:    'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  /* Spacing */
  --space-1: 4px;   --space-2: 8px;   --space-3: 12px;
  --space-4: 16px;  --space-5: 20px;  --space-6: 24px;
  --space-8: 32px;  --space-10: 40px; --space-12: 48px;
  --space-16: 64px;

  /* Radius */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   16px;
  --r-xl:   24px;
  --r-full: 9999px;

  /* Shadow */
  --shadow-xs:  0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 6px rgba(0,0,0,.05), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg:  0 10px 15px rgba(0,0,0,.07), 0 4px 6px rgba(0,0,0,.04);
  --shadow-xl:  0 20px 25px rgba(0,0,0,.08), 0 8px 10px rgba(0,0,0,.04);
  --shadow-focus: 0 0 0 3px rgba(99,102,241,.3);

  /* Transitions */
  --t-fast:   80ms ease;
  --t-base:   150ms ease;
  --t-slow:   250ms ease;

  /* Layout */
  --container: 1140px;
  --nav-h:     60px;
}

/* ── Dark Mode ──────────────────────────────────────────────── */
[data-theme="dark"] {
  --c-bg:         #0f172a;
  --c-bg-card:    #1e293b;
  --c-bg-subtle:  #1e293b;
  --c-border:     #334155;
  --c-text:       #f1f5f9;
  --c-text-muted: #94a3b8;
  --c-text-xmuted:#64748b;
  --c-primary-light: #312e81;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background var(--t-slow), color var(--t-slow);
}
main { flex: 1; }
img  { max-width: 100%; height: auto; display: block; }
a    { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--r-sm); }
ul, ol { padding-left: var(--space-6); }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── Skip Link ──────────────────────────────────────────────── */
.skip-link {
  position: absolute; top: -100%; left: var(--space-4);
  background: var(--c-primary); color: #fff;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--r-md); z-index: 9999; font-weight: 600;
}
.skip-link:focus { top: var(--space-4); }

/* ── Container ──────────────────────────────────────────────── */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-4); }
@media(min-width:768px){ .container { padding: 0 var(--space-6); } }

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  background: var(--c-bg-card);
  border-bottom: 1px solid var(--c-border);
  height: var(--nav-h);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.site-header .container {
  height: 100%; display: flex; align-items: center; gap: var(--space-4);
}
.site-logo {
  display: flex; align-items: center; gap: var(--space-2);
  color: var(--c-text); font-weight: 700; font-size: 1.1rem;
  text-decoration: none; flex-shrink: 0;
}
.site-logo:hover { text-decoration: none; }
.logo-bomb { font-size: 1.4rem; }
.logo-text span { color: var(--c-primary); }

/* Nav */
.site-nav { display: flex; align-items: center; gap: var(--space-1); margin-left: auto; }
.site-nav a {
  color: var(--c-text-muted); font-size: .875rem; font-weight: 500;
  padding: var(--space-2) var(--space-3); border-radius: var(--r-md);
  transition: background var(--t-base), color var(--t-base);
  white-space: nowrap;
}
.site-nav a:hover  { background: var(--c-bg-subtle); color: var(--c-text); text-decoration: none; }
.site-nav a.active { background: var(--c-primary-light); color: var(--c-primary); font-weight: 600; }
.nav-play {
  background: var(--c-primary) !important;
  color: #fff !important;
  padding: var(--space-2) var(--space-4) !important;
}
.nav-play:hover { background: var(--c-primary-dark) !important; }

/* Dark toggle */
.btn-theme-toggle {
  background: var(--c-bg-subtle); border: 1px solid var(--c-border);
  border-radius: var(--r-full); padding: var(--space-1) var(--space-2);
  font-size: 1rem; line-height: 1; transition: background var(--t-base);
  flex-shrink: 0;
}
.btn-theme-toggle:hover { background: var(--c-border); }

/* Mobile hamburger */
.nav-toggle {
  display: none; background: none; border: none; padding: var(--space-2);
  color: var(--c-text); margin-left: auto;
}
.nav-toggle svg { display: block; }

@media(max-width:767px) {
  .nav-toggle { display: flex; align-items: center; }
  .site-nav {
    display: none; position: fixed; inset: var(--nav-h) 0 0 0;
    background: var(--c-bg-card); flex-direction: column; align-items: stretch;
    padding: var(--space-4); gap: var(--space-2); z-index: 99;
    box-shadow: var(--shadow-xl); overflow-y: auto;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: var(--space-3) var(--space-4); font-size: 1rem; }
  .btn-theme-toggle { margin-top: auto; align-self: flex-start; }
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-5); border-radius: var(--r-md);
  font-weight: 600; font-size: .9rem; border: none;
  transition: all var(--t-base); text-decoration: none; line-height: 1.5;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn:focus-visible { box-shadow: var(--shadow-focus); outline: none; }
.btn-primary  { background: var(--c-primary); color: #fff; }
.btn-primary:hover  { background: var(--c-primary-dark); }
.btn-secondary { background: var(--c-bg-subtle); color: var(--c-text); border: 1px solid var(--c-border); }
.btn-secondary:hover { background: var(--c-border); }
.btn-ghost { background: transparent; color: var(--c-text-muted); border: 1px solid var(--c-border); }
.btn-ghost:hover { background: var(--c-bg-subtle); }
.btn-lg { padding: var(--space-3) var(--space-8); font-size: 1rem; border-radius: var(--r-lg); }
.btn-sm { padding: var(--space-1) var(--space-3); font-size: .8rem; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--c-bg-card); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}
.card-hover {
  transition: box-shadow var(--t-base), transform var(--t-base), border-color var(--t-base);
}
.card-hover:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--c-primary); }

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  padding: var(--space-16) 0;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-accent) 100%);
  color: #fff; text-align: center; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero .container { position: relative; }
.hero__badge {
  display: inline-flex; align-items: center; gap: var(--space-2);
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3);
  backdrop-filter: blur(4px); border-radius: var(--r-full);
  padding: var(--space-1) var(--space-4); font-size: .8rem; font-weight: 600;
  margin-bottom: var(--space-6); text-transform: uppercase; letter-spacing: .05em;
}
.hero__title {
  font-size: clamp(2rem, 6vw, 3.5rem); font-weight: 700;
  line-height: 1.15; margin-bottom: var(--space-4);
}
.hero__title span { opacity: .85; }
.hero__sub {
  font-size: clamp(1rem, 2.5vw, 1.2rem); opacity: .9; max-width: 600px;
  margin: 0 auto var(--space-8);
}
.hero__actions { display: flex; gap: var(--space-3); justify-content: center; flex-wrap: wrap; }
.hero .btn-primary { background: #fff; color: var(--c-primary); font-size: 1.05rem; }
.hero .btn-primary:hover { background: rgba(255,255,255,.9); }
.hero .btn-ghost  { border-color: rgba(255,255,255,.5); color: #fff; }
.hero .btn-ghost:hover { background: rgba(255,255,255,.1); }

/* ── Feature Grid ────────────────────────────────────────────── */
.features { padding: var(--space-16) 0; background: var(--c-bg-card); }
.section-header { text-align: center; margin-bottom: var(--space-12); }
.section-title  { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 700; margin-bottom: var(--space-3); }
.section-sub    { color: var(--c-text-muted); font-size: 1.05rem; max-width: 560px; margin: 0 auto; }

.features-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: var(--space-5);
}
.feature-icon {
  width: 48px; height: 48px; border-radius: var(--r-lg);
  background: var(--c-primary-light); color: var(--c-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin-bottom: var(--space-4);
}
[data-theme="dark"] .feature-icon { background: rgba(99,102,241,.2); }
.feature-title { font-size: 1rem; font-weight: 600; margin-bottom: var(--space-2); }
.feature-desc  { color: var(--c-text-muted); font-size: .9rem; line-height: 1.6; }

/* ── Content Links ───────────────────────────────────────────── */
.content-links { padding: var(--space-16) 0; }
.links-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: var(--space-5);
}
.link-card {
  display: flex; align-items: flex-start; gap: var(--space-4); text-decoration: none;
  color: var(--c-text);
}
.link-card:hover { text-decoration: none; }
.link-card .card-icon {
  font-size: 1.5rem; width: 48px; height: 48px; flex-shrink: 0;
  border-radius: var(--r-lg); background: var(--c-bg-subtle);
  display: flex; align-items: center; justify-content: center;
}
.link-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: var(--space-1); }
.link-card p  { color: var(--c-text-muted); font-size: .875rem; }

/* ── Content Article ─────────────────────────────────────────── */
.article-wrap { max-width: 820px; margin: 0 auto; padding: var(--space-8) var(--space-4); }
.article-wrap h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 700; margin-bottom: var(--space-4); }
.article-wrap h2 {
  font-size: 1.35rem; font-weight: 700; margin: var(--space-8) 0 var(--space-4);
  padding-bottom: var(--space-3); border-bottom: 2px solid var(--c-border);
}
.article-wrap h3 { font-size: 1.1rem; font-weight: 600; margin: var(--space-5) 0 var(--space-3); color: var(--c-primary); }
.article-wrap p  { margin-bottom: var(--space-4); color: var(--c-text); line-height: 1.75; }
.article-wrap ul, .article-wrap ol { margin-bottom: var(--space-4); }
.article-wrap li { margin-bottom: var(--space-2); line-height: 1.7; }
.article-intro {
  font-size: 1.1rem; color: var(--c-text-muted); margin-bottom: var(--space-6);
  padding: var(--space-4) var(--space-5); background: var(--c-bg-subtle);
  border-left: 4px solid var(--c-primary); border-radius: 0 var(--r-md) var(--r-md) 0;
}

/* ── Breadcrumb ──────────────────────────────────────────────── */
.breadcrumb { padding: var(--space-4) 0; font-size: .85rem; color: var(--c-text-muted); }
.breadcrumb ol { list-style: none; padding: 0; display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.breadcrumb li + li::before { content: '/'; opacity: .4; }
.breadcrumb a { color: var(--c-text-muted); }
.breadcrumb a:hover { color: var(--c-primary); }

/* ── CTA Box ──────────────────────────────────────────────────── */
.cta-box {
  background: linear-gradient(135deg, var(--c-primary-light), #ede9fe);
  border-radius: var(--r-xl); padding: var(--space-8); text-align: center;
  margin-top: var(--space-8);
}
[data-theme="dark"] .cta-box { background: rgba(99,102,241,.15); }
.cta-box p  { font-weight: 600; margin-bottom: var(--space-4); }
.cta-box .btn + .btn { margin-left: var(--space-3); }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group   { margin-bottom: var(--space-5); }
.form-label   { display: block; font-weight: 600; font-size: .875rem; margin-bottom: var(--space-2); }
.form-input, .form-textarea, .form-select {
  width: 100%; padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--c-border); border-radius: var(--r-md);
  font-family: var(--font-sans); font-size: .95rem;
  background: var(--c-bg-card); color: var(--c-text);
  transition: border-color var(--t-base), box-shadow var(--t-base);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none; border-color: var(--c-primary); box-shadow: var(--shadow-focus);
}
.form-textarea { resize: vertical; min-height: 120px; }
.form-hint { font-size: .8rem; color: var(--c-text-muted); margin-top: var(--space-1); }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert { padding: var(--space-4); border-radius: var(--r-md); margin-bottom: var(--space-5); font-size: .9rem; display: flex; gap: var(--space-3); }
.alert-success { background: #d1fae5; border: 1px solid #6ee7b7; color: #065f46; }
.alert-error   { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }
.alert-info    { background: #e0e7ff; border: 1px solid #a5b4fc; color: #3730a3; }
[data-theme="dark"] .alert-success { background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.3); color: #6ee7b7; }
[data-theme="dark"] .alert-error   { background: rgba(239,68,68,.1);  border-color: rgba(239,68,68,.3);  color: #fca5a5; }
[data-theme="dark"] .alert-info    { background: rgba(99,102,241,.1); border-color: rgba(99,102,241,.3); color: #a5b4fc; }

/* ── Ad Slots ────────────────────────────────────────────────── */
.ad-slot { margin: var(--space-5) 0; text-align: center; min-height: 90px; }

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  background: var(--c-bg-card); border-top: 1px solid var(--c-border);
  padding: var(--space-12) 0 var(--space-6); margin-top: var(--space-16);
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-8); margin-bottom: var(--space-8);
}
@media(max-width:767px) { .footer-grid { grid-template-columns: 1fr; gap: var(--space-6); } }
.footer-brand p { color: var(--c-text-muted); font-size: .875rem; margin-top: var(--space-3); max-width: 280px; }
.footer-heading { font-size: .85rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--c-text-xmuted); margin-bottom: var(--space-4); }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: var(--space-3); }
.footer-links a { color: var(--c-text-muted); font-size: .875rem; transition: color var(--t-base); }
.footer-links a:hover { color: var(--c-primary); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid var(--c-border); padding-top: var(--space-5);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--space-3);
  color: var(--c-text-xmuted); font-size: .8rem;
}

/* ── Page Header ─────────────────────────────────────────────── */
.page-header {
  background: var(--c-bg-card); border-bottom: 1px solid var(--c-border);
  padding: var(--space-8) 0 var(--space-6);
}
.page-header h1 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
.page-header p  { color: var(--c-text-muted); margin-top: var(--space-2); }

/* ── Error Page ──────────────────────────────────────────────── */
.error-page { text-align: center; padding: var(--space-16) 0; }
.error-page h1 { font-size: 4rem; font-weight: 700; color: var(--c-primary); }
.error-page h2 { font-size: 1.5rem; margin-bottom: var(--space-4); }
.error-page p  { color: var(--c-text-muted); margin-bottom: var(--space-8); }

/* ── Utility ──────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted  { color: var(--c-text-muted); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.gap-3 { gap: var(--space-3); }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--c-bg-subtle); }
::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--c-text-muted); }

/* ── Lang Switcher ─────────────────────────────────────────── */
.nav-lang-switch {
  display: flex; align-items: center; gap: 5px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--r-md); font-size: .8rem; font-weight: 700;
  color: var(--c-text-muted); letter-spacing: .03em;
  border: 1px solid var(--c-border);
  transition: all var(--t-base);
}
.nav-lang-switch:hover { background: var(--c-bg-subtle); color: var(--c-primary); border-color: var(--c-primary); text-decoration: none; }
.lang-flag { font-size: .9rem; }

/* ── Leaderboard Widget ─────────────────────────────────────── */
.leaderboard-widget {
  background: var(--c-bg-card); border: 1px solid var(--c-border);
  border-radius: var(--r-xl); padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}
.lb-heading {
  font-size: .85rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--c-text-muted); margin-bottom: var(--space-3);
}
.lb-tabs {
  display: flex; gap: var(--space-1); margin-bottom: var(--space-4);
  background: var(--c-bg-subtle); border-radius: var(--r-lg); padding: 3px;
}
.lb-tab {
  flex: 1; padding: var(--space-1) var(--space-2); border: none;
  background: transparent; border-radius: var(--r-md); font-size: .8rem; font-weight: 600;
  color: var(--c-text-muted); cursor: pointer; transition: all var(--t-base);
}
.lb-tab.active { background: var(--c-bg-card); color: var(--c-primary); box-shadow: var(--shadow-xs); }
.lb-tab:hover:not(.active) { color: var(--c-text); }
.lb-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.lb-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-3); border-radius: var(--r-md);
  background: var(--c-bg-subtle); font-size: .875rem;
  transition: background var(--t-base);
}
.lb-item:hover { background: var(--c-primary-light); }
[data-theme="dark"] .lb-item:hover { background: rgba(99,102,241,.15); }
.lb-rank-1 { border-left: 3px solid #f59e0b; }
.lb-rank-2 { border-left: 3px solid #94a3b8; }
.lb-rank-3 { border-left: 3px solid #b45309; }
.lb-medal { font-size: 1rem; width: 24px; text-align: center; flex-shrink: 0; }
.lb-time  { font-family: var(--font-mono); font-weight: 700; color: var(--c-primary); flex: 1; }
.lb-date  { font-size: .75rem; color: var(--c-text-xmuted); }
.lb-empty { color: var(--c-text-muted); font-size: .875rem; text-align: center; padding: var(--space-5) 0; }
.lb-panel.hidden { display: none; }

/* New record flash */
@keyframes recordFlash { 0%,100%{color:var(--c-primary);} 50%{color:#f59e0b;transform:scale(1.15);} }
.lb-new-record { animation: recordFlash .4s ease 3; }
