/* CAPTCHA — unofficial fan game site
   Palette drawn from reCAPTCHA widget aesthetics (white panel, blue strip,
   traffic-light red/yellow/green) layered onto a dark "login screen" void,
   plus the half-human/half-robot cartoon face motif seen across fan art. */

:root{
  --void: #11121c;
  --void-2: #181a2b;
  --panel: #f4f6fb;
  --panel-ink: #1b1d29;
  --blue: #4285f4;
  --blue-deep: #1c5fd1;
  --teal: #2bd4c4;
  --yellow: #ffd400;
  --red: #ff5a5a;
  --green: #35c766;
  --ink-soft: #b9bdd6;
  --ink-faint: #7d81a0;
  font-size: 16px;
}

*{ box-sizing: border-box; }
html,body{ margin:0; padding:0; }
body{
  background: var(--void);
  color: var(--ink-soft);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  line-height: 1.6;
}

a{ color: var(--teal); text-decoration: none; }
a:hover{ text-decoration: underline; }

h1,h2,h3{ color: #fdfdff; font-family: "Trebuchet MS", "Segoe UI", sans-serif; margin: 0 0 .5em; }

/* Background texture: faint captcha-grid lines */
body{
  background-image:
    linear-gradient(var(--void-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--void-2) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
}

/* ---------- Header ---------- */
.site-header{
  position: sticky; top: 0; z-index: 50;
  background: rgba(17,18,28,0.92);
  backdrop-filter: blur(6px);
  border-bottom: 2px solid var(--blue);
}
.header-inner{
  max-width: 1120px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 1.25rem;
}
.brand{ display:flex; align-items:center; gap:.6rem; }
.brand-text{
  font-weight: 800; letter-spacing: .08em; font-size: 1.3rem; color: #fff;
  text-transform: uppercase;
}
.brand:hover{ text-decoration: none; }
.main-nav{ display:flex; gap: 1.6rem; }
.main-nav a{
  color: var(--ink-soft); font-weight: 600; font-size: .95rem;
  padding: .3rem .1rem; border-bottom: 2px solid transparent;
}
.main-nav a:hover{ color:#fff; border-color: var(--yellow); text-decoration:none; }

/* ---------- Hero ---------- */
.hero{ padding: 3.2rem 1.25rem 1.5rem; }
.hero-inner{ max-width: 860px; margin: 0 auto; text-align:center; }
.eyebrow{
  color: var(--yellow); font-weight: 700; letter-spacing: .25em; font-size: .78rem;
  margin: 0 0 .6rem;
}
.hero h1{
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  letter-spacing: .04em;
  background: linear-gradient(135deg, #fff 30%, var(--teal) 70%, var(--yellow) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lead{ font-size: 1.1rem; color: var(--ink-soft); max-width: 680px; margin: 0 auto 1.3rem; }
.hero-badges{ display:flex; gap:.6rem; justify-content:center; flex-wrap: wrap; }
.badge{
  font-size: .78rem; font-weight: 700; padding: .35rem .8rem; border-radius: 999px;
  border: 1px solid transparent; text-transform: uppercase; letter-spacing: .04em;
}
.badge-red{ color: var(--red); border-color: var(--red); background: rgba(255,90,90,.08); }
.badge-yellow{ color: var(--yellow); border-color: var(--yellow); background: rgba(255,212,0,.08); }
.badge-teal{ color: var(--teal); border-color: var(--teal); background: rgba(43,212,196,.08); }

/* ---------- Game section ---------- */
.game-section{ padding: 1rem 1.25rem 3rem; }
.game-wrap{ max-width: 520px; margin: 0 auto; }

.captcha-panel{
  background: var(--panel);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.06);
}
.captcha-panel__topbar{
  display:flex; align-items:center; gap:.4rem;
  background: #e2e6ef; padding: .55rem .8rem;
  border-bottom: 1px solid #d3d8e4;
}
.captcha-panel__dot{
  width: 9px; height: 9px; border-radius: 50%; background: #c3c8d6;
}
.captcha-panel__dot:nth-child(1){ background: var(--red); }
.captcha-panel__dot:nth-child(2){ background: var(--yellow); }
.captcha-panel__dot:nth-child(3){ background: var(--green); }
.captcha-panel__title{
  margin-left: .5rem; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  color: #6b7184; font-weight: 700;
}

.captcha-panel__strip{
  background: var(--blue);
  color: #fff;
  padding: .85rem 1rem;
  display: flex; align-items: center; gap: .6rem;
  font-weight: 700; font-size: 1.02rem;
}
.strip-icon{ font-size: 1.1rem; }

.game-root{
  background: #fff;
  min-height: 300px;
  display: flex; align-items: center; justify-content: center;
  padding: 1.2rem;
}

.game-placeholder{
  display: flex; flex-direction: column; align-items: center; gap: 1.3rem;
}
.placeholder-grid{
  display: grid; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(3, 56px);
  gap: 4px;
}
.placeholder-grid span{
  background: #eef1f8; border: 1px solid #dde1ec; border-radius: 4px;
}
.placeholder-grid span.on{
  background: repeating-linear-gradient(45deg, var(--red), var(--red) 6px, #ffb3b3 6px, #ffb3b3 12px);
  position: relative;
}
.placeholder-grid span.on::after{
  content: "🚦"; position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font-size: 1.4rem;
}

.btn-begin{
  background: var(--blue);
  color: #fff; border: none; border-radius: 6px;
  font-size: 1.05rem; font-weight: 700;
  padding: .85rem 2.2rem; cursor: pointer;
  box-shadow: 0 6px 0 var(--blue-deep);
  transition: transform .08s ease;
}
.btn-begin:hover{ filter: brightness(1.05); }
.btn-begin:active{ transform: translateY(4px); box-shadow: 0 2px 0 var(--blue-deep); }

.captcha-panel__footbar{
  background: #eef1f8; border-top: 1px solid #d3d8e4;
  padding: .8rem 1rem;
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
}
.progress-track{
  flex: 1 1 160px; position: relative;
  background: #dde1ec; border-radius: 999px; height: 20px; overflow: hidden;
  min-width: 140px;
}
.progress-fill{
  background: linear-gradient(90deg, var(--teal), var(--green));
  height: 100%; width: 0%; transition: width .3s ease;
}
.progress-label{
  position: absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font-size: .72rem; font-weight: 700; color: #3a3e4d;
}
.btn-verify{
  background: var(--blue); color:#fff; border:none; border-radius: 4px;
  font-weight: 800; letter-spacing: .06em; font-size: .85rem;
  padding: .6rem 1.4rem; cursor: pointer;
  box-shadow: 0 4px 0 var(--blue-deep);
}
.btn-verify:active{ transform: translateY(3px); box-shadow: 0 1px 0 var(--blue-deep); }

.certificate{
  margin-top: 1.4rem;
  background: linear-gradient(160deg, #0f3d36, #11212b);
  border: 2px solid var(--teal);
  border-radius: 14px;
  padding: 1.6rem;
  text-align: center;
  color: #e8fffb;
}
.certificate__seal{ margin-bottom: .4rem; }
.certificate h3{ color: var(--teal); margin-bottom: .4rem; }
.certificate p{ color: #cdebe6; margin-bottom: 1rem; }
.btn-replay{
  background: var(--teal); color: #0b2622; border: none; border-radius: 6px;
  font-weight: 800; padding: .6rem 1.4rem; cursor: pointer;
}

.game-caption{
  text-align:center; font-size: .9rem; color: var(--ink-faint);
  margin-top: 1.2rem; padding: 0 .5rem;
}

/* ---------- Content blocks ---------- */
.content-block{ padding: 2.6rem 1.25rem; }
.content-block--alt{ background: var(--void-2); }
.content-inner{ max-width: 760px; margin: 0 auto; }
.content-block h2{ font-size: 1.6rem; }
.content-block p{ color: var(--ink-soft); }

.content-block--link .link-card{
  display:flex; gap: 1.1rem; align-items: flex-start;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px; padding: 1.4rem;
}
.link-card__icon{ flex: 0 0 auto; }
.link-card__body h2{ margin-bottom: .4rem; font-size: 1.4rem; }

/* ---------- FAQ ---------- */
.faq-section{ padding: 2.6rem 1.25rem 3.4rem; }
.faq-section h2{ text-align:center; margin-bottom: 1.4rem; }
.faq-list{ display: flex; flex-direction: column; gap: .7rem; }
.faq-item{
  background: var(--void-2);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: .9rem 1.1rem;
}
.faq-item summary{
  cursor: pointer; font-weight: 700; color: #fff; list-style: none;
  display: flex; align-items: center; gap: .5rem;
}
.faq-item summary::before{
  content: "?"; flex: 0 0 auto;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--yellow); color: #1b1d29;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 800;
}
.faq-item[open] summary::before{ background: var(--teal); }
.faq-item p{ margin: .7rem 0 0 1.7rem; color: var(--ink-soft); }

/* ---------- Footer ---------- */
.site-footer{
  background: #0b0c14;
  border-top: 2px solid var(--blue);
  padding: 1.8rem 1.25rem;
}
.footer-inner{ max-width: 1120px; margin: 0 auto; text-align:center; }
.footer-links{ display:flex; gap: 1.4rem; justify-content:center; margin-bottom: .8rem; }
.footer-links a{ color: var(--ink-soft); font-weight: 600; font-size: .9rem; }
.footer-links a:hover{ color: #fff; }
.footer-disclaimer{ font-size: .78rem; color: var(--ink-faint); max-width: 640px; margin: 0 auto; }

/* ---------- Responsive ---------- */
@media (max-width: 560px){
  .header-inner{ flex-direction: column; gap: .5rem; }
  .main-nav{ gap: 1rem; }
  .placeholder-grid{ grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(3, 44px); }
}

/* ---------- Game internals (game.js) ---------- */
.g-level{ width: 100%; color: var(--panel-ink); text-align: center; }
.g-grid{ display: grid; gap: 6px; justify-content: center; margin: 0 auto; }
.g-grid-3{ grid-template-columns: repeat(3, 92px); }
.g-grid-4{ grid-template-columns: repeat(4, 76px); }
.g-grid-2{ grid-template-columns: repeat(2, 140px); }
.g-cell{
  aspect-ratio: 1; font-size: 2.1rem; background: #eef1f8;
  border: 3px solid transparent; border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .08s, border-color .12s, background .12s;
  font-family: inherit;
}
.g-cell:hover{ background: #e0e6f4; }
.g-cell.sel{ border-color: var(--blue); background: #dbe7ff; transform: scale(.94); }
.g-expr{ font-size: 1.4rem; font-weight: 700; }
.g-note{ font-size: .82rem; color: #6b7184; margin: .8rem 0 0; }
.g-final-note{ font-weight: 700; color: var(--green); }
.g-checkbox{
  display: inline-flex; align-items: center; gap: .7rem;
  background: #fff; border: 2px solid #c9cfdd; border-radius: 8px;
  padding: .9rem 1.2rem; font-size: 1.1rem; cursor: pointer;
  color: var(--panel-ink); font-family: inherit;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.g-box{
  width: 26px; height: 26px; border: 2.5px solid #9aa2b5; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--green); font-weight: 900; font-size: 1.2rem; background: #fff;
}
.g-checkbox.on{ border-color: var(--green); }
.g-checkbox.on .g-box{ border-color: var(--green); }
.g-wobble{
  display: flex; gap: .35rem; justify-content: center; margin-bottom: 1rem;
  font-size: 2.2rem; font-weight: 800; color: #2c3350;
  font-family: "Courier New", monospace;
  background: linear-gradient(180deg,#e8ecf7,#d8deef);
  border: 1px dashed #9aa2b5; border-radius: 8px; padding: .7rem 1rem;
}
.g-wobble span{ display: inline-block; }
.g-input{
  display: block; margin: 0 auto; width: 200px; padding: .6rem .8rem;
  font-size: 1.1rem; text-align: center; border: 2px solid #c9cfdd;
  border-radius: 8px; font-family: inherit; color: var(--panel-ink);
}
.g-input:focus{ outline: none; border-color: var(--blue); }
.g-input-wide{ width: min(320px, 100%); }
.g-input:disabled{ background: #eef1f8; color: #9aa2b5; }
.g-agree{ width: auto; padding: .7rem 1.4rem; cursor: pointer; }
.g-code{
  font-size: 2.4rem; font-weight: 800; letter-spacing: .3em;
  font-family: "Courier New", monospace; color: #2c3350;
  background: #eef1f8; border-radius: 8px; padding: .8rem 1rem; margin-bottom: 1rem;
}
.g-mole{ cursor: pointer; }
.g-mole.up{ background: #ffe9c9; }
.g-tttc{ font-size: 2.4rem; font-weight: 800; color: var(--blue-deep); }
.g-pad{ opacity: .35; transition: opacity .15s; }
.g-pad.lit{ opacity: 1; transform: scale(.95); }
.g-red{ background: var(--red); }
.g-yellow{ background: var(--yellow); }
.g-green{ background: var(--green); }
.g-teal{ background: var(--teal); }
.g-puzzle{
  display: grid; grid-template-columns: repeat(2, 70px); gap: 4px;
  justify-content: center; margin-bottom: 1rem;
}
.g-pz{
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 2rem; background: #eef1f8; border-radius: 6px;
}
.g-pz.hole{ background: #fff; border: 2px dashed #9aa2b5; color: #9aa2b5; font-weight: 800; }
.g-canvas{
  background: #fff; border: 2px dashed #c9cfdd; border-radius: 10px;
  max-width: 100%; touch-action: none; cursor: crosshair;
}
.g-terms{
  height: 140px; overflow-y: scroll; text-align: left;
  background: #eef1f8; border: 1px solid #c9cfdd; border-radius: 8px;
  padding: .8rem; font-size: .78rem; color: #4a4f66; margin-bottom: .8rem;
}
.g-shake{ animation: gshake .4s; }
@keyframes gshake{
  0%,100%{ transform: translateX(0); }
  20%{ transform: translateX(-9px); } 40%{ transform: translateX(8px); }
  60%{ transform: translateX(-6px); } 80%{ transform: translateX(4px); }
}
.btn-verify{ transition: transform .18s ease; }

@media (max-width: 560px){
  .g-grid-3{ grid-template-columns: repeat(3, 76px); }
  .g-grid-4{ grid-template-columns: repeat(4, 62px); }
  .g-grid-2{ grid-template-columns: repeat(2, 120px); }
  .g-cell{ font-size: 1.7rem; }
}

/* ---------- Inner pages ---------- */
.page-head{ padding: 2.6rem 1.25rem 1.2rem; }
.crumbs{ font-size: .85rem; color: var(--ink-faint); margin-bottom: .9rem; display:flex; gap:.5rem; }
.crumbs a{ color: var(--ink-soft); }
.page-head h1{ font-size: clamp(1.7rem, 4.5vw, 2.4rem); line-height: 1.15; }
.lead{ font-size: 1.05rem; color: var(--ink-soft); }
.lead .badge{ vertical-align: middle; margin-left: .4rem; }
.fine-note{ font-size: .8rem; color: var(--ink-faint); }

.guide-cards{
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: .9rem; margin-top: 1.2rem;
}
.guide-card{
  background: var(--void); border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px; padding: .95rem 1rem;
}
.guide-card h3{ font-size: .98rem; color: var(--yellow); margin-bottom: .35rem; }
.guide-card p{ font-size: .85rem; margin: 0; }

.tablewrap{ overflow-x: auto; margin-top: 1rem; }
.guide-table{
  width: 100%; border-collapse: collapse; font-size: .88rem;
}
.guide-table th{
  text-align: left; color: var(--yellow); padding: .55rem .7rem;
  border-bottom: 2px solid var(--blue); white-space: nowrap;
}
.guide-table td{
  padding: .5rem .7rem; border-bottom: 1px solid rgba(255,255,255,.07);
  vertical-align: top; color: var(--ink-soft);
}
.guide-table tbody tr:hover{ background: rgba(255,255,255,.03); }
