@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;600;700&family=Quicksand:wght@400;600&display=swap');

html, body {
  font-family: 'Quicksand', sans-serif;
}

h1, h2, h3, button, .title {
  font-family: 'Baloo 2', cursive;
  letter-spacing: 0.5px;
}


:root {
  --bg: #fef9ef;
  --panel: #ffffff;
  --text: #333333;
  --muted: #b08b74;
  --brand: #ff7b54;
  --brand2: #ffd56b;
  --border: #ffd6a5;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;

  
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}

.h1 {
  font-size: clamp(1.6rem, 2vw + 1rem, 2.4rem);
  margin: 0 0 0.5rem;
}

.muted {
  color: var(--muted);
}

.card {
  background: #fff5e4;
  border: 1px solid #ffd6a5;
  border-radius: var(--radius);
  padding: 1rem;
}

.btn {
  display: inline-block;
  text-decoration: none;
  color: var(--text);
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffb26b;
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(255, 184, 77, 0.3);
  border-color: var(--brand);
}
/* ===== Navigation ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
  background: #ffe8c8;
  border-bottom: 1px solid var(--border);
}

.navbar .inner {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  max-width: 1100px;
  margin: 0 auto;
}

.brand {
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 1rem;
  color: var(--brand);
}

.nav {
  display: flex;
  gap: 0.4rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.nav a {
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid transparent;
  transition: transform 0.15s, background 0.2s, color 0.2s, border-color 0.2s;
}

.nav a:hover {
  transform: translateY(-1px);
  color: var(--text);
  background: rgba(255, 171, 92, 0.1);
  border-color: rgba(255, 171, 92, 0.25);
}

.nav a.active {
  color: #0f1220;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
}

main {
  padding: calc(64px + 1.2rem) 1rem 4rem;
}
/* ===== Mobile Responsive ===== */
@media (max-width: 600px) {
  .navbar {
    position: fixed;
    top: auto;
    bottom: 0;
    border-bottom: none;
    border-top: 1px solid var(--border);
    background: var(--panel);
    width: 100%;
  }

  main {
    padding: 1rem 1rem 120px; 
  }
}

/* ===== 6×6 Grid ===== */
.grid-6 {
  grid-template-columns: repeat(6, minmax(36px, 1fr));
}

.grid-6 .cell {
  border: 1px solid #1e2338;
}

.grid-6 .cell:nth-child(6n+3) {
  border-right: 2px solid var(--brand);
}

.grid-6 .cell:nth-child(n+7):nth-child(-n+12),
.grid-6 .cell:nth-child(n+19):nth-child(-n+24) {
  border-bottom: 2px solid var(--brand);
}

@media (max-width: 600px) {
  .grid-6 {
    grid-template-columns: repeat(6, minmax(44px, 1fr));
  }
}

/* ===== Grid Layouts ===== */
.grid {
  display: grid;
  gap: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  margin: 1rem 0;
}

.grid-9 {
  grid-template-columns: repeat(9, minmax(40px, 1fr));
}

/* ===== Cell Styling ===== */
.cell {
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--border);
}

.cell input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  outline: none;
  transition: background 0.2s;
}

.cell input:focus {
  background: rgba(108, 140, 255, 0.1);
}

.cell input::placeholder {
  color: var(--muted);
  opacity: 0.5;
}

/* ===== 9×9 Grid Subgrid Borders ===== */
.grid-9 .cell:nth-child(9n+3),
.grid-9 .cell:nth-child(9n+6) {
  border-right: 2px solid var(--brand);
}

.grid-9 .cell:nth-child(n+19):nth-child(-n+27),
.grid-9 .cell:nth-child(n+46):nth-child(-n+54) {
  border-bottom: 2px solid var(--brand);
}

/* ===== Form Styling ===== */
.input {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(108, 140, 255, 0.1);
}

label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 500;
  color: var(--text);
}

/* ===== Game List Styling ===== */
.game-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.game-list li {
  margin-bottom: 0.5rem;
}

.game-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  background: var(--bg);
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
}

.game-link:hover {
  transform: translateY(-1px);
  border-color: var(--brand);
  background: rgba(108, 140, 255, 0.05);
}

.game-title {
  font-weight: 600;
}

.game-author {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ===== Timer Styling ===== */
.timer {
  font-family: monospace;
  font-weight: 600;
  color: var(--brand);
  background: rgba(108, 140, 255, 0.1);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  border: 1px solid rgba(108, 140, 255, 0.2);
}

/* ===== Table Styling ===== */
table {
  border-collapse: separate;
  border-spacing: 0;
}

th {
  background: var(--bg);
  font-weight: 600;
  color: var(--brand);
}

tr:hover {
  background: rgba(108, 140, 255, 0.05);
}

tr:hover td {
  border-color: rgba(108, 140, 255, 0.2);
}

/* ===== Row Layout ===== */
.row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ===== Additional Mobile Responsive ===== */
@media (max-width: 600px) {
  .grid-9 { grid-template-columns: repeat(9, minmax(32px, 1fr)); }
  .cell input { font-size: 1rem; }

  .game-link {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .row { flex-direction: column; }
}

/* ===== Collapsible Navbar Toggle (Mobile only) ===== */
@media (max-width: 600px) {
 
  .nav-toggle-btn {
    position: fixed;
    bottom: 80px;             
    right: 1rem;
    background: linear-gradient(135deg, var(--brand), var(--brand2));
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    z-index: 999;
    transition: opacity .3s, transform .2s;
  }


  .nav-toggle-btn .when-closed { display: none; }
  #nav-compact:checked ~ .nav-toggle-btn .when-open { display: none; }
  #nav-compact:checked ~ .nav-toggle-btn .when-closed { display: inline; }


  header.navbar { transition: transform .3s ease, opacity .3s ease; }
  #nav-compact:checked ~ header.navbar {
    transform: translateY(80%); 
    opacity: .5;
  }
}

