* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #850000;
  font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
  color: #222;
}

a { color: inherit; }

.wrap {
  max-width: 1160px;
  margin: 30px auto;
  background: #fff;
  border: 3px solid #ff8f5a;
  display: grid;
  grid-template-columns: 250px 1fr 232px;
  grid-template-areas:
    "left center right"
    "footer footer footer";
}

/* ---------- Левая колонка ---------- */
.left { grid-area: left; background: #1c2529; }

.logo {
  display: block;
  background: #fff;
  padding: 6px 10px 8px;
  text-decoration: none;
  line-height: 1;
}
.logo .l1 {
  display: block;
  font-family: "Comic Sans MS", "Marker Felt", cursive;
  font-style: italic;
  color: #f26a21;
  font-size: 20px;
}
.logo .l1 b {
  font-size: 34px;
  color: #e8441d;
  text-shadow: 1px 1px 0 #7a1a00;
  letter-spacing: 1px;
}
.logo .l2 {
  display: block;
  margin-top: 2px;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 30px;
  color: #1f4f9d;
  letter-spacing: -1px;
  text-shadow: 1px 1px 0 #9ab3db;
}
.logo .l2 i {
  font-family: "Comic Sans MS", "Marker Felt", cursive;
  font-size: 22px;
  color: #f26a21;
  text-shadow: none;
}

.search {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: #ff8f5a;
}
.search input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 14px;
  padding: 3px 5px;
  border: 1px solid #999;
}
.search button {
  font: inherit;
  font-size: 14px;
  padding: 3px 8px;
  border: 1px solid #999;
  background: #f0f0f0;
  cursor: pointer;
}

.menu { padding: 36px 20px 30px 50px; }
.menu a {
  display: block;
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  line-height: 1.45;
}
.menu a:hover { text-decoration: underline; }
.menu a.big::first-letter { font-size: 22px; }
.menu a.person { font-size: 14px; font-weight: bold; margin-bottom: 8px; }
.menu a.person span { font-weight: normal; color: #ffb48f; }
.menu .gap { height: 30px; }
.menu .gap.small { height: 14px; }

/* ---------- Центр ---------- */
.center {
  grid-area: center;
  border-left: 3px solid #ff8f5a;
  padding: 22px 18px 30px;
  min-width: 0;
}

#news {
  border: 4px solid #ff8f5a;
  border-radius: 6px;
  padding: 4px;
}

.card {
  border: 4px solid #ff8f5a;
  border-radius: 6px;
  padding: 12px 14px 26px;
  margin-bottom: 4px;
  text-align: center;
}
.card:last-child { margin-bottom: 0; }
.card .title {
  display: block;
  font-size: 17px;
  font-weight: bold;
  color: #444;
  text-decoration: none;
  margin-bottom: 26px;
}
.card .title:hover { text-decoration: underline; }
.card img {
  width: 210px;
  height: 150px;
  object-fit: cover;
  display: block;
  margin: 0 auto;
}
.card .red {
  display: inline-block;
  margin-top: 22px;
  color: #ff0000;
  font-size: 20px;
  text-decoration: none;
}
.card .red:hover { text-decoration: underline; }

.page {
  margin-top: 26px;
  border: 4px solid #ff8f5a;
  border-radius: 6px;
  padding: 18px 22px 22px;
  scroll-margin-top: 10px;
}
.page h1 {
  margin: 0 0 10px;
  font-size: 28px;
  color: #850000;
}
.page h2 {
  margin: 18px 0 12px;
  font-size: 21px;
  color: #850000;
}
.page h2:first-child { margin-top: 0; }
.page p { line-height: 1.6; font-size: 16px; margin: 0 0 12px; }
.page .lead { font-size: 17px; }
.page a { color: #1f4f9d; }

.persona {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin: 16px 0 6px;
}
.persona img {
  width: 260px;
  height: 260px;
  object-fit: cover;
  border: 4px solid #ff8f5a;
  flex-shrink: 0;
}
.facts { border-collapse: collapse; font-size: 15px; width: 100%; }
.facts th, .facts td {
  text-align: left;
  vertical-align: top;
  padding: 6px 8px;
  border-bottom: 1px dotted #ccc;
}
.facts th { color: #666; font-weight: normal; white-space: nowrap; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}
.vid {
  display: block;
  text-decoration: none;
  color: #333 !important;
}
.vid img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border: 3px solid #ff8f5a;
  border-radius: 4px;
}
.vid b { display: block; margin-top: 6px; font-size: 14px; line-height: 1.3; }
.vid span { display: block; font-size: 13px; color: #ff0000; margin-top: 3px; }
.vid:hover b { text-decoration: underline; }

/* ---------- Правая колонка ---------- */
.right {
  grid-area: right;
  padding: 18px 12px 18px 0;
}
.rbox {
  background: #dcdcdc;
  padding: 50px 10px 70px 26px;
}
.rbox a {
  display: block;
  color: #000;
  text-decoration: none;
  font-size: 19px;
  line-height: 1.35;
  margin-bottom: 6px;
}
.rbox a:hover { text-decoration: underline; }
.rbox a.boxed {
  border: 1px solid #000;
  padding: 3px 18px;
  margin: 0 0 54px -16px;
}

/* ---------- Подвал ---------- */
.footer {
  grid-area: footer;
  border-top: 3px solid #ff8f5a;
  background: #1c2529;
  color: #ddd;
  font-size: 13px;
  padding: 14px 20px;
  text-align: center;
  line-height: 1.5;
}
.footer a { color: #ffb48f; }

/* ---------- Cookie ---------- */
.cookie {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(610px, 100%);
  background: #333;
  color: #fff;
  text-align: center;
  padding: 18px 20px 14px;
  font-size: 15px;
  z-index: 10;
}
.cookie[hidden] { display: none; }
.cookie p { margin: 0 0 16px; line-height: 1.4; }
.cookie button {
  border: 0;
  color: #fff;
  font: inherit;
  font-size: 14px;
  padding: 9px 20px;
  margin: 0 5px;
  cursor: pointer;
}
.cookie .ok { background: #0b8ef2; }
.cookie .no { background: #f2423a; }

/* ---------- Игра ---------- */
.game-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  background: #ffd23f;
  color: #1c2529;
  border: 3px solid #1c2529;
  box-shadow: 5px 5px 0 #1c2529, 0 0 0 3px #ff8f5a;
  font: 13px "Press Start 2P", monospace;
  cursor: pointer;
  animation: game-bounce 1.6s ease-in-out infinite;
}
.game-btn img { width: 44px; height: 44px; image-rendering: pixelated; }
.game-btn:hover { background: #fff; }
.game-btn:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 #1c2529, 0 0 0 3px #ff8f5a; }
@keyframes game-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) { .game-btn { animation: none; } }
@media (max-width: 1000px) {
  body:has(.cookie:not([hidden])) .game-btn { bottom: 175px; }
}

.card img.pixel { image-rendering: pixelated; }

body.game-open { overflow: hidden; }

.game-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(20, 0, 0, .88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.game-modal[hidden] { display: none; }
.game-box {
  width: min(960px, 100%, calc((100dvh - 220px) * 16 / 9));
  min-width: min(320px, 100%);
  background: #1c2529;
  border: 4px solid #ff8f5a;
  box-shadow: 0 0 0 4px #850000, 0 20px 60px rgba(0, 0, 0, .6);
}
.game-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: #ffd23f;
  font: 11px/1.4 "Press Start 2P", monospace;
}
.game-head b { flex: 1; font-weight: normal; }
.game-head button {
  width: 38px;
  height: 34px;
  background: #333;
  color: #fff;
  border: 2px solid #ff8f5a;
  font-size: 16px;
  cursor: pointer;
}
.game-head button:hover { background: #ff8f5a; }
#gameCanvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  image-rendering: pixelated;
  touch-action: none;
}
.game-ult {
  --e: 0%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 10px;
  border: 0;
  border-top: 3px solid #ff8f5a;
  background: linear-gradient(90deg, #1f6f8b var(--e), #2a3338 var(--e));
  color: #fff;
  font: 12px "Press Start 2P", monospace;
  cursor: not-allowed;
}
.game-ult:disabled { opacity: 1; }
.game-ult kbd {
  font: 9px "Press Start 2P", monospace;
  padding: 3px 5px;
  border: 2px solid currentColor;
}
.game-ult.ready {
  background: linear-gradient(90deg, #ff8f2a, #ffd23f, #fff3a0, #ffd23f, #ff8f2a);
  background-size: 200% 100%;
  color: #3a1500;
  cursor: pointer;
  box-shadow: 0 0 22px #ffd23f;
  animation: ult-ready 0.8s linear infinite;
}
@keyframes ult-ready { to { background-position: 200% 0; } }
.game-help { margin: 0; padding: 9px 12px 11px; color: #ddd; font-size: 13px; text-align: center; }
.game-pad { display: none; }
@media (hover: none), (pointer: coarse) {
  .game-help, .game-ult kbd { display: none; }
  .game-pad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 10px;
  }
  .game-pad button {
    padding: 16px 0;
    background: #333;
    color: #fff;
    border: 3px solid #ff8f5a;
    font: 14px "Press Start 2P", monospace;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
  }
  .game-pad button:active { background: #ff8f5a; }
}

/* ---------- Мобильные ---------- */
@media (max-width: 960px) {
  .wrap {
    margin: 0;
    border-width: 0;
    grid-template-columns: 1fr;
    grid-template-areas: "left" "center" "right" "footer";
  }
  .menu {
    padding: 14px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
  }
  .menu .gap { display: none; }
  .menu a.person { margin: 0; }
  .center { border-left: 0; padding: 14px 12px 20px; }
  .right { padding: 0 12px 20px; }
  .rbox { padding: 20px 16px; }
  .rbox a.boxed { margin: 0 0 16px; display: inline-block; }
}

@media (max-width: 560px) {
  .persona { flex-direction: column; align-items: center; }
  .persona img { width: 200px; height: 200px; }
  .card .red { font-size: 17px; }
  .page { padding: 14px; }
  .game-btn { right: 12px; bottom: 12px; padding-right: 10px; font-size: 11px; }
  .game-modal { padding: 0; }
  .game-head b { font-size: 9px; }
}
