:root {
  --blue: #1e4d7b;
  --blue-2: #2b6ea8;
  --paper: #f6f8fb;
  --ink: #1f2933;
  --muted: #627d98;
  --line: #d9e2ec;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", Calibri, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.45;
  min-height: 100vh;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 20px 16px 48px; }
header.app { background: var(--blue); color: #fff; padding: 16px 0; }
header.app .wrap {
  padding-top: 0; padding-bottom: 0;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
header h1 { font-size: 18px; margin: 0; font-weight: 700; }
header .sub { opacity: .85; font-size: 13px; margin-top: 2px; }
header .nav { display: flex; gap: 8px; flex-wrap: wrap; }
header .nav a {
  color: #fff; text-decoration: none; font-weight: 700; font-size: 13px;
  border: 1px solid rgba(255,255,255,.45); padding: 7px 12px; border-radius: 9px;
}
header .nav a.on, header .nav a:hover { background: rgba(255,255,255,.16); }
h2 { margin: 22px 0 8px; font-size: 18px; color: var(--blue); }
p.lead { color: var(--muted); margin: 0 0 8px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.subj {
  display: block; text-decoration: none; color: inherit;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px;
}
.subj b { display: block; color: var(--blue); font-size: 16px; }
.subj span { color: var(--muted); font-size: 13px; }
.subj:hover { border-color: var(--blue-2); }

.scene { perspective: 1000px; margin-top: 8px; }
.card {
  position: relative;
  min-height: 240px;
  transform-style: preserve-3d;
  transition: transform .45s;
  cursor: pointer;
}
.card.show { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 20px;
  display: flex; flex-direction: column; justify-content: center;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.face .tag {
  position: absolute; top: 12px; left: 16px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
}
.face p { margin: 18px 0 0; font-size: 20px; font-weight: 650; }
.back { transform: rotateY(180deg); background: #eef4fa; }
.back p { font-weight: 600; font-size: 18px; }

.bar { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; color: var(--muted); font-size: 14px; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
button {
  appearance: none; border: 0; background: var(--blue); color: #fff;
  font: inherit; font-weight: 700; padding: 11px 16px; border-radius: 10px; cursor: pointer;
}
button.ghost { background: #fff; color: var(--blue); border: 1px solid var(--blue); }
button:disabled { opacity: .45; cursor: not-allowed; }
.hint { color: var(--muted); font-size: 13px; margin-top: 10px; }
