:root {
  --ink: #14211c;
  --muted: #5c6b63;
  --green: #0c3d34;
  --green-2: #176b52;
  --gold: #9a7430;
  --gold-2: #e8d7a8;
  --sand: #f4efe6;
  --paper: rgba(255, 253, 249, 0.92);
  --line: #e4d8c4;
  --live: #b42318;
  --ok: #157a45;
  --bad: #8d2e2e;
  --shadow: 0 18px 50px rgba(20, 40, 32, 0.08);
  --red: #ce1126;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Cairo, Tahoma, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(206, 17, 38, 0.06), transparent 22%),
    radial-gradient(circle at 90% 0%, rgba(154, 116, 48, 0.16), transparent 26%),
    linear-gradient(180deg, #fbf8f2 0%, #f3eee4 48%, #efe6d6 100%);
  min-height: 100vh;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; }

.flagbar {
  display: flex;
  direction: ltr;
  height: 8px;
  position: sticky;
  top: 0;
  z-index: 6;
}
.flagbar i { flex: 1; display: block; }
.flagbar i:nth-child(1) { background: var(--red); }
.flagbar i:nth-child(2) { background: #009639; }
.flagbar i:nth-child(3) { background: #fff; }
.flagbar i:nth-child(4) { background: #111; }

.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 5vw;
  background: rgba(255, 252, 247, 0.9);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 8px;
  z-index: 5;
  backdrop-filter: blur(12px);
}
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; }
.moe-mini {
  width: 54px;
  height: 54px;
  object-fit: contain;
  background: white;
  border-radius: 14px;
  padding: 4px;
  border: 1px solid var(--line);
}
.brand strong { display: block; font-size: 18px; line-height: 1.2; }
.brand small { color: var(--gold); font-weight: 700; }
.top nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.top nav a, .ghost, .btn, .choice, .lang {
  border-radius: 999px;
  padding: 8px 14px;
  text-decoration: none;
  border: 1px solid var(--line);
  background: white;
}
.lang {
  background: var(--green);
  color: #f8f3e6;
  border-color: var(--green);
  font-weight: 700;
}
.btn.primary, button.primary { background: var(--green); color: #f8f4ea; border-color: var(--green); }
.btn.gold, button.gold { background: linear-gradient(180deg, #c6a15a, var(--gold)); color: white; border-color: #8d6828; }
.btn.danger, button.danger { background: white; color: var(--bad); border-color: #e7c8c8; }
.btn.live, button.live { background: var(--live); color: white; border-color: var(--live); }
button.primary, button.gold, button.danger, button.live, .ghost, .choice, .btn { border-radius: 999px; padding: 10px 16px; }
main { width: min(1180px, calc(100% - 32px)); margin: 28px auto 40px; }
main.wide { width: min(1280px, calc(100% - 28px)); }

.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 28px;
  padding: 16px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.site-footer img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: white; }
.site-footer strong { color: var(--green); display: block; }
.footer-logos { display: flex; gap: 10px; align-items: center; }
.footer-logos img.moe { width: 58px; height: 58px; border-radius: 12px; object-fit: contain; background: white; padding: 4px; }

.hero-banner {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 18px;
  padding: 28px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.72), rgba(255,250,240,0.9)),
    var(--paper);
}
.wordmark { height: 72px; width: auto; object-fit: contain; margin-bottom: 8px; }
.kicker { color: var(--gold); font-weight: 800; margin: 0 0 8px; letter-spacing: 0; }
h1 { font-size: clamp(32px, 4vw, 52px); line-height: 1.35; margin: 0 0 12px; }
h2 { margin: 0 0 8px; font-size: 28px; }
h3 { margin: 0 0 8px; }
.lead { font-size: 18px; line-height: 1.8; color: #31423b; }
.stage { position: relative; min-height: 340px; display: grid; place-items: center; }
.school-photo {
  width: min(300px, 70%);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 8px solid white;
  box-shadow: 0 16px 40px rgba(20, 40, 32, 0.18);
}
.flag-photo {
  position: absolute;
  width: 132px;
  height: 88px;
  object-fit: cover;
  border-radius: 18px;
  border: 4px solid white;
  box-shadow: var(--shadow);
  bottom: 18px;
  inset-inline-start: 8px;
}
.seal-photo {
  position: absolute;
  width: 118px;
  height: 118px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--gold-2);
  background: white;
  top: 8px;
  inset-inline-end: 4px;
  box-shadow: var(--shadow);
}
.doors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 16px; }
.door {
  padding: 18px;
  text-decoration: none;
  min-height: 168px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.4), transparent 28%),
    var(--paper);
}
.door:hover { border-color: var(--gold); transform: translateY(-3px); }
.door b { color: var(--gold); font-size: 13px; }
.door span { color: var(--muted); line-height: 1.7; }
.panel, .card, .door {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.panel { padding: 22px; }
.slogan {
  margin-top: 18px;
  padding: 12px 16px;
  border-inline-start: 4px solid var(--gold);
  background: #faf6ee;
  border-radius: 12px;
  font-weight: 800;
}

.facts div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.facts div:last-child { border-bottom: 0; }
.facts span { color: var(--muted); font-weight: 700; }
.preview {
  white-space: pre-wrap;
  max-height: 140px;
  overflow: auto;
  color: var(--muted);
  margin-top: 8px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
label { display: block; font-weight: 700; margin: 12px 0 6px; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  border-radius: 14px;
  padding: 12px 14px;
}
textarea { min-height: 90px; resize: vertical; line-height: 1.7; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 14px; }
.list-card { display: block; padding: 16px 18px; text-decoration: none; }
.list-card + .list-card { margin-top: 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 4px 10px; background: #f3ecdf; color: var(--green);
  font-size: 13px; font-weight: 700;
}
.pill.on { background: #f8e4df; color: var(--live); }
.pill.ok { background: #e5f5ec; color: var(--ok); }
.pill.bad { background: #f8e8e8; color: var(--bad); }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button[aria-selected="true"] { background: var(--green); color: white; border-color: var(--green); }
.activity { padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: #fff; margin-top: 12px; }
.question { padding: 12px; background: #f7f1e6; border-radius: 14px; margin-top: 10px; }
.feedback { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: white; }
.feedback.ok { border: 1px solid #b7e0c6; }
.feedback.bad { border: 1px solid #efc7c7; }
.choice.on { border-color: var(--green); background: #eef6f2; }
.tier .choice[aria-pressed="true"] { background: var(--green); color: white; }
.modal { position: fixed; inset: 0; background: rgba(16, 28, 24, 0.66); display: grid; place-items: center; padding: 18px; z-index: 20; }
.modal-card { width: min(1100px, 100%); height: min(86vh, 860px); background: white; border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; }
.modal-card header { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; }
.modal-card iframe { flex: 1; border: 0; width: 100%; background: #dfe7ea; }
.board {
  min-height: calc(100vh - 8px);
  padding: 28px 6vw 48px;
  background:
    radial-gradient(circle at 100% 0%, rgba(154, 116, 48, 0.25), transparent 24%),
    #10241e;
  color: #f7f1e4;
}
.board-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.board .brand-line { color: var(--gold-2); font-size: 22px; font-weight: 800; }
.board h1 { font-size: clamp(40px, 6vw, 78px); }
.board .body { font-size: clamp(26px, 3vw, 44px); line-height: 1.75; white-space: pre-wrap; }
.board .controls { margin-top: 24px; }
.board button { background: transparent; color: #f7f1e4; border: 1px solid rgba(247, 241, 228, 0.35); }
.board .lang { background: transparent; }
.visit-grid { display: grid; grid-template-columns: 1.35fr 0.8fr; gap: 14px; align-items: start; }
.side { position: sticky; top: 86px; padding: 16px; }
.person { padding: 12px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.toast { position: fixed; bottom: 18px; inset-inline-start: 18px; background: var(--green); color: white; padding: 12px 16px; border-radius: 14px; z-index: 30; max-width: 340px; }
.toast.bad { background: var(--bad); }
.objectives { margin: 0; padding-inline-start: 18px; line-height: 1.8; }
.plan dt { font-weight: 800; margin-top: 12px; color: var(--green); }
.plan dd { margin: 4px 0 0; white-space: pre-wrap; line-height: 1.8; }

@media (max-width: 980px) {
  .hero-banner, .grid-2, .doors, .visit-grid { grid-template-columns: 1fr 1fr; }
  .doors { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .hero-banner, .grid-2, .grid-3, .visit-grid, .doors { grid-template-columns: 1fr; }
  .top, .site-footer { padding: 14px 16px; align-items: flex-start; flex-direction: column; }
  .side { position: static; }
  .stage { min-height: 280px; }
  main { width: min(100% - 20px, 1180px); }
}
