/* Jayden Eka Putra — shared site styles */
@import url('https://fonts.googleapis.com/css2?family=Lilita+One&family=Nunito:wght@500;700;800;900&display=swap');

:root {
  --bg: #14153a;
  --card: #1e2046;
  --card-2: #2a2c5e;
  --ink: #0a0b1e;
  --text: #fff7e8;
  --muted: #c9c6e8;
  --yellow: #ffbf00;
  --blue: #4c97ff;
  --orange: #ff8c1a;
  --green: #59c059;
  --red: #ff5c5c;
  --level: var(--blue);
  --level-ink: #ffffff;
  --radius: 18px;
  --shadow: 0 6px 0 var(--ink);
}
body.tut-2 { --level: var(--orange); --level-ink: #2a1200; }
body.tut-3 { --level: var(--red); --level-ink: #ffffff; }

* { box-sizing: border-box; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(rgba(255,255,255,0.06) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  color: var(--text);
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--yellow); }
a:hover { color: #ffffff; }

h1, h2, h3, h4 { font-family: 'Lilita One', sans-serif; font-weight: 400; letter-spacing: 0.3px; }

.container { max-width: 900px; margin: 0 auto; padding: 48px 20px; position: relative; }

/* ---------- Header ---------- */
header { margin-bottom: 40px; }
header h1 {
  font-size: clamp(2.6rem, 7vw, 4.2rem);
  line-height: 1;
  margin: 0 0 14px;
  color: var(--text);
}
header h2 { font-size: 1.5rem; color: var(--level); margin: 0; }
header p { font-size: 1.25rem; color: var(--muted); max-width: 600px; margin: 0; text-wrap: pretty; }

/* Home page header */
body.home header h1 span, body.home header h1 { color: var(--yellow); }

/* Tutorial pages: header becomes a level card */
body[class^="tut-"] header {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: 0 8px 0 var(--ink);
  padding: 26px 24px;
  border-top: 14px solid var(--level);
}

/* ---------- Home: achievement cards ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 48px;
}
.skill-card {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.skill-card h3 { margin: 0 0 6px; font-size: 1.6rem; color: var(--yellow); }
.skill-card:nth-child(1) h3 { color: var(--blue); }
.skill-card:nth-child(2) h3 { color: var(--orange); }
.skill-card:nth-child(3) h3 { color: var(--green); }
.skill-card p { margin: 0; color: var(--muted); font-size: 1rem; }

/* ---------- Home: menu ---------- */
.menu-section h2 { font-size: 2rem; margin: 0 0 18px; }
.links-list { display: flex; flex-direction: column; gap: 16px; }

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.15rem;
  padding: 18px 22px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.nav-item:hover { color: var(--text); transform: translateY(-3px); box-shadow: 0 9px 0 var(--ink); }
.nav-item:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }

.nav-item .tag {
  display: inline-block;
  font-family: 'Lilita One', sans-serif;
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 8px;
  border: 2px solid var(--ink);
  background: var(--blue);
  color: #fff;
  margin-right: 6px;
}
.links-list .nav-item:nth-child(2) .tag { background: var(--orange); color: #2a1200; }
.links-list .nav-item:nth-child(3) .tag { background: var(--red); }

.nav-item .arrow {
  flex: none;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--yellow);
  transition: transform 0.15s ease;
}
.nav-item:hover .arrow { transform: translateX(4px); }

.nav-item.games-btn { background: var(--green); color: #0d2a0d; font-size: 1.3rem; padding: 24px; }
.nav-item.games-btn .tag { background: #0d2a0d; color: var(--green); }
.nav-item.games-btn .arrow { background: #0d2a0d; color: var(--green); }

/* ---------- Arcade ---------- */
body.arcade .container { max-width: 1080px; }
body.arcade h1 { text-align: center; font-size: clamp(2.6rem, 7vw, 4.2rem); line-height: 1; margin: 0 0 10px; }
p.subtitle { text-align: center; color: var(--muted); font-size: 1.2rem; margin: 0 0 40px; }

.arcade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.game-card {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease;
}
.game-card:hover { transform: translateY(-4px) rotate(-0.5deg); }
.game-card a { display: block; border-bottom: 3px solid var(--ink); }
.game-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--card-2); }
.game-card h3 { margin: 0; padding: 14px 16px; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1.05rem; line-height: 1.3; }
.arcade-grid .game-card:nth-child(1) { border-color: var(--yellow); }

/* ---------- Tutorial steps ---------- */
ol { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 22px; counter-reset: step; }
li {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 22px;
}
li h3 {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 14px;
  font-size: 1.4rem;
  color: var(--text);
}
li h3::before {
  counter-increment: step;
  content: counter(step);
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 3px solid var(--ink);
  background: var(--level);
  color: var(--level-ink);
  font-size: 1.3rem;
}
li img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 3px solid var(--ink);
  margin-bottom: 14px;
  background: #fff;
}
li p, p { margin: 0; }
li p { font-size: 1.1rem; line-height: 1.9; }

/* Scratch-block style code */
code, .flag-text {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.95em;
  background: var(--yellow);
  color: #3b2700;
  padding: 3px 10px;
  border-radius: 8px;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.22);
  white-space: nowrap;
}
strong { color: #ffd84d; font-weight: 900; }

/* Badge (tutorial 1) */
.tutorial-badge {
  position: absolute;
  top: 18px; right: 20px;
  z-index: 10;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
  background: var(--red);
  color: #fff;
  font-weight: 900;
  font-size: 0.8rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  border: 3px solid var(--ink);
  transform: rotate(4deg);
}

/* Prerequisite box (tutorial 2) */
.prereq-box {
  background: #2a2350;
  border: 3px dashed var(--yellow);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 30px;
}
.prereq-box h4 { margin: 0 0 6px; font-size: 1.3rem; color: var(--yellow); }
.prereq-box p { font-size: 1.05rem; }
.prereq-box a { font-weight: 900; }

/* Finish card */
.conclusion {
  margin-top: 34px;
  background: var(--level);
  color: var(--level-ink);
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: 0 8px 0 var(--ink);
  padding: 30px;
  text-align: center;
}
.conclusion h2 { font-size: 2.3rem; line-height: 1.05; margin: 0 0 10px; color: inherit; }
.conclusion p { font-weight: 700; color: inherit !important; opacity: 1; }

/* Back button + footer */
.back-nav { text-align: center; margin-top: 36px; }
.home-link {
  display: inline-block;
  font-family: 'Lilita One', sans-serif;
  font-size: 1.2rem;
  text-decoration: none;
  color: var(--text);
  background: var(--card);
  padding: 12px 22px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 5px 0 var(--ink);
  transition: transform 0.15s ease;
}
.home-link:hover { color: var(--yellow); transform: translateY(-2px); }

footer { text-align: center; margin-top: 56px; color: #8f8cc0; font-weight: 700; font-size: 0.95rem; }

@media (max-width: 560px) {
  .tutorial-badge { position: static; display: inline-block; margin-bottom: 14px; }
  .nav-item { font-size: 1rem; }
}
