/* BIG LITTLE GAMES - Main Stylesheet */

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

:root {
  --bg: #0d0d0d; --surface: #161616; --card: #1e1e1e; --card-hover: #252525;
  --accent: #f5c842; --accent-dim: #d4a520; --red: #e84343;
  --text: #f0f0f0; --text-muted: #888888; --border: #2a2a2a; --border-light: #333;
  --radius: 10px; --radius-sm: 6px; --transition: 220ms ease-out;
  --shadow-lift: 0 8px 24px rgba(0,0,0,.6); --nav-height: 64px;
}

html { scroll-behavior: smooth; }
body { font-family: 'DM Mono', monospace; background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: 'Lilita One', cursive; font-weight: 400; letter-spacing: 0.02em; }

body.site-loading .navbar,
body.site-loading main,
body.site-loading .site-footer,
body.site-loading .music-widget { visibility: hidden; }
body.site-ready .site-loader { opacity: 0; pointer-events: none; visibility: hidden; }
.site-loader { position: fixed; inset: 0; z-index: 5000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; background: #0d0d0d; color: var(--text); transition: opacity 260ms ease, visibility 260ms ease; }
.site-loader-mark { display: flex; align-items: center; gap: 12px; }
.site-loader-icon { width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; background: var(--accent); color: #0d0d0d; border-radius: var(--radius-sm); transform: rotate(-4deg); }
.site-loader-icon::before { content: ''; display: block; width: 0; height: 0; border-top: 11px solid transparent; border-bottom: 11px solid transparent; border-left: 18px solid #0d0d0d; transform: translateX(2px); }
.site-loader-icon svg { display: none; }
.site-loader-title { font-family: 'Lilita One', cursive; font-size: 1.8rem; line-height: 1; }
.site-loader-title span { color: var(--accent); }
.site-loader-bar { width: min(360px, 82vw); height: 8px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; }
.site-loader-bar span { display: block; width: 8%; height: 100%; background: var(--accent); border-radius: inherit; transition: width 180ms ease-out; }
.site-loader-text { min-height: 20px; font-size: .78rem; color: var(--text-muted); text-align: center; }

/* Navbar */
.navbar { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; height: var(--nav-height); background: rgba(13,13,13,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 24px; }
.nav-inner { max-width: 1400px; width: 100%; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-logo-icon { width: 36px; height: 36px; background: var(--accent); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; transform: rotate(-4deg); }
.nav-logo-icon::before { content: ''; display: block; width: 0; height: 0; border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-left: 14px solid #0d0d0d; transform: translateX(2px); }
.nav-logo-icon svg { display: none; }
.nav-logo-text { font-family: 'Lilita One', cursive; font-size: 1.35rem; color: var(--text); }
.nav-logo-text span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-sm); font-size: .82rem; color: var(--text-muted); transition: color var(--transition), background var(--transition); text-transform: uppercase; letter-spacing: .02em; }
.nav-link:hover, .nav-link.active { color: var(--text); background: rgba(255,255,255,.05); }
.nav-link svg { width: 16px; height: 16px; opacity: .7; }
.nav-link[data-admin-link] { display: none; }
.nav-link[data-admin-link].admin-visible { display: flex; }
.nav-search { position: relative; flex-shrink: 0; }
.nav-search input { width: 220px; padding: 9px 14px 9px 38px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-family: inherit; font-size: .82rem; outline: none; transition: border-color var(--transition), width var(--transition); }
.nav-search input::placeholder { color: var(--text-muted); }
.nav-search input:focus { border-color: var(--accent); width: 280px; }
.nav-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
.nav-menu-btn { display: none; padding: 8px; color: var(--text-muted); }
.nav-menu-btn svg { width: 24px; height: 24px; }

/* Main */
main { padding-top: var(--nav-height); }
.container { max-width: 1400px; margin: 0 auto; padding: 0 24px; }

/* Hero */
.hero { padding: 48px 0 32px; }
.hero-inner { display: grid; grid-template-columns: 1fr 380px; gap: 32px; align-items: stretch; }
.hero-card { position: relative; border-radius: 14px; overflow: hidden; background: var(--card); cursor: pointer; transition: transform var(--transition); }
.hero-card:hover { transform: scale(1.005); }
.hero-card-img { width: 100%; height: 100%; min-height: 360px; object-fit: cover; }
.hero-card-overlay { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(13,13,13,.95) 0%, rgba(13,13,13,.4) 40%, transparent 70%); display: flex; flex-direction: column; justify-content: flex-end; padding: 32px; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: #0d0d0d; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 5px 10px; border-radius: 4px; width: fit-content; margin-bottom: 12px; }
.hero-badge svg { width: 12px; height: 12px; }
.hero-title { font-size: 2.4rem; line-height: 1.1; margin-bottom: 8px; }
.hero-desc { font-size: .88rem; color: var(--text-muted); max-width: 480px; margin-bottom: 20px; }
.hero-tags { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.hero-tag { font-size: .72rem; padding: 4px 10px; border-radius: 4px; background: rgba(255,255,255,.08); color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.btn-play { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: #0d0d0d; font-family: 'Lilita One', cursive; font-size: 1rem; padding: 12px 28px; border-radius: var(--radius); transition: background var(--transition), transform var(--transition); letter-spacing: .03em; }
.btn-play svg { width: 18px; height: 18px; }
.btn-play:hover { background: var(--accent-dim); transform: translateY(-1px); }

/* Hero sidebar */
.hero-sidebar { display: flex; flex-direction: column; gap: 12px; }
.hero-sidebar-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); padding-bottom: 8px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.hero-sidebar-title svg { width: 16px; height: 16px; color: var(--red); }
.trending-item { display: flex; align-items: center; gap: 14px; padding: 10px 12px; background: var(--card); border-radius: var(--radius-sm); border: 1px solid transparent; transition: border-color var(--transition), background var(--transition); cursor: pointer; }
.trending-item:hover { border-color: var(--border-light); background: var(--card-hover); }
.trending-thumb { width: 56px; height: 56px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.trending-info { flex: 1; min-width: 0; }
.trending-name { font-size: .88rem; font-weight: 500; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trending-meta { display: flex; align-items: center; gap: 10px; font-size: .72rem; color: var(--text-muted); }
.trending-meta svg { width: 12px; height: 12px; }
.trending-rank { font-family: 'Lilita One', cursive; font-size: 1.2rem; color: var(--border-light); flex-shrink: 0; width: 28px; text-align: center; }

/* Section */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; padding-top: 48px; }
.section-title { font-size: 1.5rem; display: flex; align-items: center; gap: 10px; }
.section-title svg { width: 22px; height: 22px; color: var(--accent); }

/* Category Tabs */
.category-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-tab { padding: 7px 16px; border-radius: 20px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); border: 1px solid var(--border); background: transparent; transition: all var(--transition); cursor: pointer; }
.cat-tab:hover { color: var(--text); border-color: var(--border-light); }
.cat-tab.active { color: #0d0d0d; background: var(--accent); border-color: var(--accent); }

/* Game Grid */
.game-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding-bottom: 64px; }
.game-card { position: relative; background: var(--card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition); cursor: pointer; opacity: 0; transform: translateY(20px); animation: cardIn 400ms ease-out forwards; }
.game-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: var(--border-light); }
@keyframes cardIn { to { opacity: 1; transform: translateY(0); } }
.game-card:nth-child(1){animation-delay:0ms}.game-card:nth-child(2){animation-delay:40ms}.game-card:nth-child(3){animation-delay:80ms}.game-card:nth-child(4){animation-delay:120ms}.game-card:nth-child(5){animation-delay:160ms}.game-card:nth-child(6){animation-delay:200ms}.game-card:nth-child(7){animation-delay:240ms}.game-card:nth-child(8){animation-delay:280ms}.game-card:nth-child(n+9){animation-delay:320ms}
.card-thumb-wrap { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #111; }
.card-thumb { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease-out; }
.game-card:hover .card-thumb { transform: scale(1.05); }
.game-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-color: var(--accent); }
.card-play-overlay { position: absolute; inset: 0; background: rgba(13,13,13,.55); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity var(--transition); }
.game-card:hover .card-play-overlay { opacity: 1; }
.card-play-btn { width: 52px; height: 52px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; transform: scale(.8); transition: transform var(--transition); }
.game-card:hover .card-play-btn { transform: scale(1); }
.card-play-btn svg { width: 22px; height: 22px; color: #0d0d0d; margin-left: 2px; }
.card-body { padding: 14px 16px 16px; }
.card-category { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: 6px; }
.card-title { font-family: 'Lilita One', cursive; font-size: 1.05rem; margin-bottom: 8px; line-height: 1.2; }
.card-meta { display: flex; align-items: center; gap: 12px; font-size: .72rem; color: var(--text-muted); }
.card-meta-item { display: flex; align-items: center; gap: 4px; }
.card-meta-item svg { width: 13px; height: 13px; }

/* Featured scroll */
.featured-scroll { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 16px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.featured-scroll::-webkit-scrollbar { display: none; }
.featured-scroll .game-card { min-width: 280px; max-width: 320px; flex-shrink: 0; scroll-snap-align: start; }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 48px 24px 32px; margin-top: 48px; }
.footer-inner { max-width: 1400px; margin: 0 auto; display: flex; justify-content: space-between; align-items: flex-start; gap: 48px; flex-wrap: wrap; }
.footer-brand { max-width: 320px; }
.footer-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.footer-logo-icon { width: 28px; height: 28px; background: var(--accent); border-radius: 4px; display: flex; align-items: center; justify-content: center; transform: rotate(-4deg); }
.footer-logo-icon::before { content: ''; display: block; width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 10px solid #0d0d0d; transform: translateX(1px); }
.footer-logo-icon svg { display: none; }
.footer-logo-text { font-family: 'Lilita One', cursive; font-size: 1.1rem; }
.footer-logo-text span { color: var(--accent); }
.footer-tagline { font-size: .82rem; color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; }
.footer-disclaimer { font-size: .72rem; color: #555; line-height: 1.6; }
.footer-nav { display: flex; gap: 48px; }
.footer-col h4 { font-family: 'Lilita One', cursive; font-size: .88rem; margin-bottom: 14px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { font-size: .8rem; color: var(--text-muted); transition: color var(--transition); }
.footer-col a:hover { color: var(--accent); }
.footer-help { margin-top: 10px; font-size: .76rem; color: var(--text-muted); }
.footer-help a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom { max-width: 1400px; margin: 32px auto 0; padding-top: 24px; border-top: 1px solid var(--border); text-align: center; font-size: .72rem; color: #555; }
.footer-beta { max-width: 1400px; margin: 20px auto 0; padding: 16px 20px; background: rgba(245,200,66,.06); border: 1px solid rgba(245,200,66,.15); border-radius: var(--radius-sm); display: flex; align-items: flex-start; gap: 12px; }
.footer-beta svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; margin-top: 1px; }
.footer-beta-text { font-size: .75rem; color: var(--text-muted); line-height: 1.6; }
.footer-beta-text strong { color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }

/* Feedback Form */
.footer-feedback-col { min-width: 260px; max-width: 320px; }
.footer-form { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.hidden-field { display: none; }
.footer-form select,
.footer-form textarea {
  width: 100%; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-family: 'DM Mono', monospace;
  font-size: .8rem; outline: none; transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none; appearance: none;
}
.footer-form select { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.footer-form select option { background: var(--surface); color: var(--text); }
.footer-form textarea { resize: vertical; min-height: 70px; max-height: 160px; line-height: 1.5; }
.footer-form textarea::placeholder { color: var(--text-muted); }
.footer-form select:focus,
.footer-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(245,200,66,.12); }
.form-submit-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; background: var(--accent); color: #0d0d0d; font-family: 'Lilita One', cursive;
  font-size: .88rem; border-radius: var(--radius-sm); border: none; cursor: pointer;
  transition: background var(--transition), transform 120ms ease;
}
.form-submit-btn svg { width: 16px; height: 16px; }
.form-submit-btn:hover { background: var(--accent-dim); transform: translateY(-1px); }
.form-submit-btn:active { transform: translateY(0); }
.form-submit-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.form-submit-btn.success { background: #34c759; }
.form-success-msg { font-size: .78rem; color: #34c759; padding: 6px 0; animation: fadeInUp 300ms ease-out; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* No results */
.no-results { grid-column: 1/-1; text-align: center; padding: 80px 20px; color: var(--text-muted); }
.no-results svg { width: 48px; height: 48px; margin-bottom: 16px; opacity: .3; }

/* Mobile nav overlay */
.mobile-nav-overlay { display: none; position: fixed; inset: 0; z-index: 999; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
.mobile-nav-overlay.open { display: block; }
.mobile-nav-panel { position: fixed; top: 0; right: 0; width: 280px; height: 100%; background: var(--surface); border-left: 1px solid var(--border); z-index: 1001; padding: 24px; display: flex; flex-direction: column; gap: 8px; transform: translateX(100%); transition: transform 250ms ease-out; }
.mobile-nav-overlay.open .mobile-nav-panel { transform: translateX(0); }
.mobile-nav-close { align-self: flex-end; padding: 8px; color: var(--text-muted); margin-bottom: 16px; }
.mobile-nav-close svg { width: 24px; height: 24px; }
.mobile-nav-link { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: .9rem; color: var(--text-muted); transition: all var(--transition); }
.mobile-nav-link:hover { background: rgba(255,255,255,.05); color: var(--text); }
.mobile-nav-link svg { width: 18px; height: 18px; }
.mobile-nav-link[data-admin-link] { display: none; }
.mobile-nav-link[data-admin-link].admin-visible { display: flex; }

/* Thumbnail placeholder (rendered when img fails to load) */
.thumb-placeholder {
  width: 100%;
  aspect-ratio: 16/10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-radius: 6px 6px 0 0;
}
.thumb-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 60%);
}
.ph-icon {
  color: rgba(255,255,255,0.5);
  position: relative;
  z-index: 1;
}
.ph-icon svg {
  width: 32px;
  height: 32px;
}
.ph-title {
  font-family: 'Lilita One', cursive;
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
  position: relative;
  z-index: 1;
  line-height: 1.2;
}
.ph-category {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  position: relative;
  z-index: 1;
}
/* Legacy class compat */
.thumb-title {
  position: relative;
  z-index: 1;
  font-family: 'Lilita One', cursive;
  font-size: .92rem;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.7);
  line-height: 1.2;
}
.thumb-tag {
  position: relative;
  z-index: 1;
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.65);
  background: rgba(0,0,0,.3);
  padding: 2px 8px;
  border-radius: 4px;
}
/* When thumb-placeholder is inside .card-thumb-wrap, fill it */
.card-thumb-wrap > .thumb-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
  border-radius: 0;
}

/* Music Widget */
.music-widget { position: fixed; bottom: 24px; right: 24px; z-index: 1000; }
.music-toggle { width: 48px; height: 48px; background: var(--surface); border: 1px solid var(--border); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-muted); box-shadow: 0 4px 12px rgba(0,0,0,.3); transition: all var(--transition); }
.music-toggle:hover { background: var(--card-hover); color: var(--accent); border-color: var(--border-light); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.4); }
.music-toggle svg { width: 20px; height: 20px; }
.music-icon-on { color: var(--accent); }

/* Responsive */
@media(max-width:1100px){ .game-grid{grid-template-columns:repeat(3,1fr)} .hero-inner{grid-template-columns:1fr 300px} }
@media(max-width:860px){ .game-grid{grid-template-columns:repeat(2,1fr)} .hero-inner{grid-template-columns:1fr} .hero-sidebar{display:none} .nav-links{display:none} .nav-menu-btn{display:block} .nav-search input{width:160px} .nav-search input:focus{width:200px} }
@media(max-width:540px){ .game-grid{grid-template-columns:1fr;gap:16px} .hero-title{font-size:1.8rem} .hero-card-img{min-height:260px} .section-header{flex-direction:column;align-items:flex-start;gap:12px} .footer-inner{flex-direction:column} .footer-nav{flex-direction:column;gap:24px} .nav-search{display:none} .footer-feedback-col{max-width:100%} }
@media(max-width:375px){
  .game-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-body { padding: 10px 12px 12px; }
  .card-title { font-size: 0.9rem; }
  .card-category { font-size: 0.6rem; }
  .card-meta { flex-direction: column; align-items: flex-start; gap: 4px; }
  .hero-inner { gap: 16px; }
  .hero-title { font-size: 1.4rem; }
  .hero-card-img { min-height: 200px; }
  .hero-card-overlay { padding: 20px; }
  .section-title { font-size: 1.2rem; }
  .music-widget { bottom: 16px; right: 16px; }
  .music-toggle { width: 40px; height: 40px; }
  .music-toggle svg { width: 16px; height: 16px; }
}
