/* Halaman cara bermain. Memakai variabel, tombol, dan kartu dari style.css. */
.howto { --cw: 52px; --ch: 73px; line-height: 1.55; }
@media (max-width: 600px) { .howto { --cw: 40px; --ch: 56px; } }
.howto b { color: var(--gold); }
.howto .card b { color: inherit; }
.howto kbd {
  padding: 1px 6px;
  border-radius: 5px;
  border-bottom: 2px solid rgba(0, 0, 0, .4);
  background: rgba(255, 255, 255, .15);
  font: 700 .85em system-ui, sans-serif;
  white-space: nowrap;
}
.btn {
  display: inline-block;
  padding: .7em 1.8em;
  border-radius: 10px;
  font-weight: 800;
  color: #3a2600;
  text-decoration: none;
  background: linear-gradient(180deg, #ffdc80, #e8a92c);
  box-shadow: 0 3px 0 #a8741a, 0 6px 12px rgba(0, 0, 0, .3);
  transition: transform .08s;
}
.btn:hover { transform: translateY(-2px); }

.hero { max-width: 640px; margin: 0 auto; padding: 6vh 16px 24px; text-align: center; }
.hero h1 { margin: 10px 0; font-size: clamp(28px, 6vw, 44px); line-height: 1.15; text-shadow: 0 4px 12px rgba(0, 0, 0, .5); }
.hero h1 span { display: block; color: var(--gold); }
.hero .lead { margin: 0 0 20px; opacity: .85; }

#toc {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(8, 30, 18, .85);
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}
@media (max-width: 760px) { #toc { justify-content: flex-start; } }
#toc a {
  flex: none;
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  background: rgba(255, 255, 255, .08);
  transition: background .2s, color .2s;
}
#toc a.on { color: #3a2600; background: var(--gold); }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }

main { max-width: 860px; margin: 0 auto; padding: 16px 16px 40px; display: flex; flex-direction: column; gap: 22px; }
.part {
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(31, 94, 62, .75), rgba(16, 58, 38, .75));
  box-shadow: 0 14px 40px rgba(0, 0, 0, .35);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .6s, transform .6s cubic-bezier(.2, .8, .3, 1);
}
.part.in { opacity: 1; transform: none; }
@media (max-width: 600px) { .part { padding: 16px; } }
.part h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 22px; }
.part h2 i {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-style: normal;
  color: #3a2600;
  background: var(--gold);
}
.part h3 { margin: 0 0 6px; }
.part p { margin: 8px 0; }
.sub { margin-top: 22px !important; }
.note, .warn p {
  padding: 10px 14px;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: rgba(0, 0, 0, .2);
}
.warn p { border-color: #ff8a80; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.tile {
  padding: 16px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .2);
  transition: transform .2s, background .2s;
}
.tile:hover { transform: translateY(-4px); background: rgba(0, 0, 0, .3); }
.tile > b { display: block; font-size: 30px; }
.tile p { margin: 0; font-size: 14px; opacity: .9; }
.part.in .tile { animation: popin .5s backwards cubic-bezier(.2, 1.3, .4, 1); }
.part.in .tile:nth-child(2) { animation-delay: .1s; }
.part.in .tile:nth-child(3) { animation-delay: .2s; }
.part.in .tile:nth-child(4) { animation-delay: .3s; }
.part.in .tile:nth-child(5) { animation-delay: .4s; }
.part.in .tile:nth-child(6) { animation-delay: .5s; }

/* Deretan urutan kartu */
.ladder { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; padding: 8px 0 4px; }
.part.in .ladder .card { animation: dealin .45s backwards cubic-bezier(.2, .8, .3, 1); animation-delay: calc(var(--i, 0) * 50ms); }
.ladder .card { transition: transform .15s; }
.ladder .card:hover { transform: translateY(-8px); }
.arrow {
  position: relative;
  display: flex;
  justify-content: space-between;
  max-width: 560px;
  margin: 4px auto 8px;
  padding-top: 10px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .8;
}
.arrow::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  border-radius: 9px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .2), var(--gold));
}
.arrow::after { content: "▶"; position: absolute; right: -6px; top: -7px; color: var(--gold); font-size: 14px; }

/* Kuis */
.game { margin-top: 18px; padding: 16px; border-radius: 16px; background: rgba(0, 0, 0, .25); text-align: center; }
.duel { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 10px 0; }
.duel .vs { font-weight: 900; font-size: 20px; color: var(--gold); }
.pick {
  --cw: 76px;
  --ch: 106px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .06);
  box-shadow: none;
  transition: transform .15s, background .2s;
}
.pick:hover { transform: translateY(-6px) rotate(-2deg); background: rgba(255, 255, 255, .14); }
.pick .card { animation: flipin .4s cubic-bezier(.2, .8, .3, 1); }
.pick.win { background: rgba(142, 240, 166, .35); box-shadow: 0 0 0 3px #8ef0a6; }
.pick.lose { animation: shake .35s; background: rgba(255, 120, 100, .3); }
.feedback { min-height: 1.6em; font-weight: 700; }
.ok { color: #8ef0a6; }
.bad { color: #ffb4a8; }
.score { margin: 0; font-size: 14px; opacity: .85; }

/* Kombinasi */
.fan { display: flex; padding-left: calc(var(--cw) * .45); }
.fan .card { margin-left: calc(var(--cw) * -.45); }
.fan.deal .card { animation: dealin .4s backwards cubic-bezier(.2, .8, .3, 1); }
.fan.deal .card:nth-child(2) { animation-delay: .05s; }
.fan.deal .card:nth-child(3) { animation-delay: .1s; }
.fan.deal .card:nth-child(4) { animation-delay: .15s; }
.fan.deal .card:nth-child(5) { animation-delay: .2s; }
.combos { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; padding: 0; margin: 10px 0; list-style: none; }
.combo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .2);
  text-align: center;
}
.combo-card h4, .combo-row h4 { margin: 0; font-size: 17px; color: var(--gold); }
.combo-card p, .combo-row p { margin: 0; font-size: 14px; }
.combo-card small, .combo-row small { opacity: .7; font-size: 12.5px; }
.combos.five { grid-template-columns: 1fr; gap: 8px; }
.combo-row {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .2);
  cursor: pointer;
  transition: background .2s, transform .2s;
  outline: none;
}
.combo-row:hover, .combo-row:focus-visible { background: rgba(0, 0, 0, .32); transform: translateX(4px); }
.combo-row .lvl {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-weight: 900;
  background: rgba(255, 255, 255, .12);
}
.combo-row .meter { position: absolute; left: 14px; right: 14px; bottom: 6px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .08); }
.combo-row .meter i {
  display: block;
  height: 100%;
  width: calc((var(--lvl) + 1) * 20%);
  border-radius: inherit;
  background: linear-gradient(90deg, #8ef0a6, var(--gold), #ff6b6b);
  transform-origin: left;
}
.part.in .combo-row .meter i { animation: grow .8s backwards cubic-bezier(.2, .8, .3, 1); animation-delay: calc(var(--lvl) * 120ms + .2s); }
@media (max-width: 600px) {
  .combo-row { grid-template-columns: auto 1fr; }
  .combo-row .fan { grid-column: 1 / -1; justify-self: center; }
}

/* Simulasi */
.sim { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: center; margin: 12px 0; }
@media (max-width: 700px) { .sim { grid-template-columns: 1fr; } }
.minitable {
  position: relative;
  height: 300px;
  border-radius: 999px;
  border: 10px solid var(--wood);
  background: radial-gradient(ellipse at 50% 40%, var(--felt), var(--felt-dark));
  box-shadow: inset 0 0 40px rgba(0, 0, 0, .5), 0 0 0 3px #3b210f, 0 12px 30px rgba(0, 0, 0, .5);
}
.mseat {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80px;
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
  transition: opacity .3s;
}
.mseat[data-p="0"] { left: 50%; bottom: -14px; transform: translateX(-50%); }
.mseat[data-p="1"] { left: -6px; top: 50%; transform: translateY(-50%); }
.mseat[data-p="2"] { left: 50%; top: -16px; transform: translateX(-50%); }
.mseat[data-p="3"] { right: -6px; top: 50%; transform: translateY(-50%); }
.mseat b { color: var(--text); }
.mseat small { opacity: .75; font-size: 11px; }
.mav {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .85);
  font-weight: 900;
  background: hsl(var(--hue), 55%, 45%);
  transition: box-shadow .3s, transform .3s;
}
.mseat.turn .mav { box-shadow: 0 0 0 4px var(--gold), 0 0 22px var(--gold); transform: scale(1.12); }
.mseat.passed { opacity: .55; }
.mtag { margin-top: 2px; padding: 0 6px; border-radius: 6px; font-size: 10.5px; font-weight: 800; background: rgba(0, 0, 0, .55); animation: popin .3s; }
.mtag.gold { color: #3a2600; background: var(--gold); }
.mcenter {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  --cw: 40px;
  --ch: 56px;
}
.mcombo { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: rgba(0, 0, 0, .35); }
.mempty { font-size: 14px; font-weight: 700; opacity: .7; animation: fadein .4s; }
.caption { display: flex; flex-direction: column; gap: 10px; }
.caption p { min-height: 5.2em; margin: 0; padding: 12px 14px; border-radius: 12px; background: rgba(0, 0, 0, .25); }
.dots { display: flex; gap: 6px; flex-wrap: wrap; }
.dot {
  width: 12px;
  height: 12px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  box-shadow: none;
}
.dot.on { background: var(--gold); transform: scale(1.3); }
.simbtns { display: flex; gap: 8px; }
.simbtns button { flex: 1; }
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.rules > div { display: flex; gap: 10px; padding: 12px; border-radius: 12px; background: rgba(0, 0, 0, .2); }
.rules > div > b { flex: none; font-size: 20px; }
.rules p { margin: 0; font-size: 14px; }

/* Siki */
.revdemo { padding: 14px; border-radius: 16px; text-align: center; background: rgba(0, 0, 0, .2); transition: background .8s, filter .8s; }
.revdemo .ladder { flex-wrap: nowrap; }
.revdemo.reversed { background: rgba(90, 30, 120, .45); }
.revdemo.reversed .arrow::before { background: linear-gradient(90deg, rgba(255, 255, 255, .2), #d18cff); }
.revdemo.reversed .arrow::after { color: #d18cff; }
.bullets { margin: 12px 0 0; padding-left: 20px; }
.bullets li { margin: 4px 0; }

/* Latihan */
.practice { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 8px; border-radius: 16px; background: radial-gradient(ellipse at 50% 30%, rgba(34, 135, 79, .6), rgba(0, 0, 0, .2)); }
.ptable { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: calc(var(--ch) + 50px); }
.plabel { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; opacity: .7; }
.pname { font-size: 13px; font-weight: 700; }
.pstatus { min-height: 1.6em; font-weight: 800; text-align: center; }
.phand { display: flex; justify-content: center; padding: 26px 0 6px calc(var(--cw) * .45); max-width: 100%; }
.phand .slot {
  margin-left: calc(var(--cw) * -.45);
  transform: translateY(var(--y)) rotate(var(--r));
  transform-origin: 50% 130%;
  transition: transform .18s;
  cursor: pointer;
}
@media (hover: hover) { .phand .slot:hover { transform: translateY(calc(var(--y) - 8px)) rotate(var(--r)); } }
.phand .slot.sel { transform: translateY(calc(var(--y) - 22px)) rotate(var(--r)); }
.phand .slot.sel .card { box-shadow: 0 0 0 3px var(--gold), 0 10px 18px rgba(0, 0, 0, .45); }
.pbtns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

.cta { padding: 20px; text-align: center; }
.cta h2 { margin: 0 0 14px; }

@keyframes dealin { from { opacity: 0; transform: translateY(-30px) rotate(-12deg) scale(.7); } }
@keyframes flipin { from { opacity: 0; transform: rotateY(90deg); } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes grow { from { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .part { opacity: 1; transform: none; transition: none; }
}

/* Kemenangan spesial: 13 kartu dirapatkan, deretan di bawah info */
.combo-row.special { grid-template-columns: auto 1fr; }
.combo-row.special .fan { grid-column: 1 / -1; justify-self: center; }
.fan.tight { --cw: 40px; --ch: 56px; padding-left: calc(var(--cw) * .55); }
.fan.tight .card { margin-left: calc(var(--cw) * -.55); }
@media (max-width: 600px) { .fan.tight { --cw: 34px; --ch: 48px; } }

.tiles.roles h3 { margin: 4px 0 6px; }
.tiles.roles .rolepill { font-size: 13px; padding: 2px 12px; }

.hero { position: relative; }
.hero > .langseg { position: absolute; top: 12px; right: 16px; }
