/* Homepage Styles for nivyan.com */

/* Fonts are preloaded in index.html, so we use font-display: swap for better performance */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600&family=Quicksand:wght@500;700&display=swap');

:root {
  --sky: #87CEEB;
  --sun: #FFD93D;
  --grass: #6BCB77;
  --card: #FFF9E6;
  --accent: #FF6B6B;
  --accent2: #4ECDC4;
  --text: #2D3436;
  --shadow: 0 8px 24px rgba(0,0,0,0.12);
}

body {
  margin: 0;
  font-family: 'Quicksand', sans-serif;
  background: linear-gradient(180deg, var(--sky) 0%, #B8E0F0 50%, var(--grass) 100%);
  min-height: 100vh;
  color: var(--text);
  padding: 0 16px 40px;
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

/* Intro / Hero */
header {
  text-align: center;
  padding: 32px 16px 24px;
}

.logo {
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
  text-shadow: 2px 2px 0 rgba(255,255,255,0.8);
}

.tagline {
  font-size: 1.15rem;
  color: #555;
  margin: 0 0 8px;
}

.intro {
  font-size: 1rem;
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto 24px;
  color: #444;
}

/* Category sections */
section {
  margin-bottom: 28px;
}

h2 {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.4rem;
  color: var(--text);
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 3px solid var(--accent2);
  display: inline-block;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.game-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.game-link {
  display: block;
  padding: 14px 16px;
  background: var(--card);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: var(--shadow);
  border: 2px solid rgba(255,255,255,0.9);
  transition: transform 0.2s, box-shadow 0.2s;
}

.game-link:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
  border-color: var(--accent2);
}

.game-link:active {
  transform: translateY(-1px);
}

.game-link.new {
  position: relative;
  background: linear-gradient(135deg, #FFD93D 0%, #FFB84D 100%);
  border: 2px solid #FFA500;
  box-shadow: 0 8px 24px rgba(255, 217, 61, 0.3), var(--shadow);
}

.game-link.new::before {
  content: "NEW";
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  letter-spacing: 0.5px;
}

.game-link.new:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(255, 217, 61, 0.4), 0 12px 28px rgba(0,0,0,0.18);
  border-color: #FF8C00;
}

.game-link.coming-soon {
  cursor: default;
  opacity: 0.85;
  color: var(--text-muted, #666);
}

.game-link.coming-soon:hover {
  transform: none;
  box-shadow: var(--shadow);
}

.game-link.coming-soon em {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  font-style: normal;
  color: var(--text-muted, #888);
  margin-top: 4px;
}

/* Rating stars and count */
.game-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: #555;
  min-height: 1.4em;
}

.game-rating-stars {
  display: inline-flex;
  gap: 2px;
  cursor: pointer;
}

.game-rating-stars[aria-disabled="true"] {
  cursor: default;
  pointer-events: none;
}

.game-rating-star {
  color: #ddd;
  transition: color 0.15s ease;
  font-size: 1rem;
  line-height: 1;
  user-select: none;
}

.game-rating-star.filled {
  color: var(--sun);
}

.game-rating-star.half {
  background: linear-gradient(90deg, var(--sun) 50%, #ddd 50%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.game-rating-star:hover:not(.filled):not(.half) {
  color: #ffc107;
}

.game-rating-count {
  margin-left: 2px;
  font-weight: 500;
}

footer {
  text-align: center;
  padding: 32px 16px 16px;
  font-size: 0.9rem;
  color: #666;
}

footer a {
  color: var(--accent2);
  font-weight: 600;
}
