
:root {
  --navy: #000f8c;
  --navy-dark: #001d9c;
  --yellow: #ffff00;
  --red: #ff0000;
  --link: #0000ee;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif;
  color: #000;
  #background-image: linear-gradient(0deg, #fafafa 25%, #ffffff 25%, #ffffff 50%, #fafafa 50%, #fafafa 75%, #ffffff 75%, #ffffff 100%);
  background-image: linear-gradient(0deg, #212121 25%, #121212 25%, #121212 50%, #212121 50%, #212121 75%, #121212 75%, #121212 100%);
  background-size: 80px 80px;
}

h1 { font-size: clamp(26px, 4vw, 35px); color: #000; margin: 0 0 8px; }
h2 { font-size: 25px; color: #000; margin: 0 0 8px; }
p  { font-size: clamp(16px, 2vw, 19px); line-height: 1.5; color: #000; margin: 0 0 12px; font-weight: bold; }

a { color: var(--link); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid #00a2ff;
  outline-offset: 2px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 66px;
  #background: var(--navy);
  background: #08007A;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
}
.topbar :focus-visible { outline-color: #fff; }

.logo {
  color: var(--red);
  font-size: 50px;
  font-weight: bold;
  line-height: 1;
  text-shadow: 2px 2px 2px #000;
  text-decoration: none;
}
.ver {
  color: var(--yellow);
  font-size: 20px;
  text-shadow: 2px 2px 2px #000;
  white-space: nowrap;
}

.auth {
  margin-left: auto;
  display: flex;
  gap: 10px;
}

.menu-toggle {
  display: none;
  margin-left: auto;
  font: inherit;
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  background: var(--navy-dark);
  border: 2px solid #fff;
  border-radius: 10px;
  padding: 4px 12px;
  cursor: pointer;
}

.btn {
  display: inline-block;
  min-width: 90px;
  padding: 8px 16px;
  border: 2px solid var(--navy);
  border-radius: 15px;
  background-image: linear-gradient(90deg, rgba(255, 170, 0, 1) 0%, rgba(237, 221, 83, 1) 50%, rgba(255, 170, 0, 1) 100%);
  color: #000;
  font: inherit;
  font-size: 17px;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.05); }
.btn-light { background: #fff; background-image: none; }

.btn-block { display: block; width: 100%; }

.solidbtn {
  display: inline-block;
  min-width: 90px;
  padding: 8px 16px;
  border: 2px solid var(--navy);
  background-image: linear-gradient(90deg, rgba(255, 170, 0, 1) 0%, rgba(237, 221, 83, 1) 50%, rgba(255, 170, 0, 1) 100%);
  color: #000;
  font: inherit;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.shell {
  display: flex;
  align-items: flex-start;
  flex: 1;
}

.sidebar {
  flex-shrink: 0;
  width: 170px;
  #background: var(--navy);
  background: #08007A;
  padding: 6px 0 12px;
  align-self: stretch;
}
.sidebar a {
  display: block;
  color: #fff;
  font-size: 25px;
  padding: 6px 10px;
  text-decoration: none;
  line-height: 1.35;
}
.sidebar a:hover { background: var(--navy-dark); }
.sidebar a[aria-current="page"] { background: var(--navy-dark); text-decoration: underline; }

.content {
  flex: 1;
  min-width: 0;
  padding: 16px clamp(14px, 3vw, 28px) 28px;
  max-width: 1000px;
}

.links-row {
  text-align: center;
  margin: 16px 0 0;
  font-size: 16px;
  font-weight: normal;
}
.links-row a { margin: 0 14px; }

.game-panel {
  max-width: 420px;
  margin: 24px auto 0;
  background: #000;
  padding: 0;
  line-height: 0;
}
.game-panel img {
  width: 100%;
  height: auto;
  display: block;
}

.stats { font-size: 16px; font-weight: normal; }
.canvas-frame {
  max-width: 640px;
  margin: 12px 0;
  border: 3px solid var(--navy);
  line-height: 0;
}
#canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
}

.board-list {
  border: 3px solid var(--navy);
  background: #fff;
  margin-top: 12px;
}
.board {
  padding: 12px 16px;
  border-bottom: 2px solid #c9cff0;
}
.board:last-child { border-bottom: 0; }
.board h2 { font-size: 22px; margin: 0; }
.board p { font-weight: normal; font-size: 16px; margin: 2px 0 0; }
.board-meta { font-size: 15px; margin: 4px 0 0; }

.box {
  max-width: 440px;
  margin: 24px 0;
  background: #fff;
  border: 3px solid var(--navy);
  padding: clamp(16px, 3vw, 24px);
}

.box2 {
  max-width: 440px;
  margin: 24px 0;
  background: linear-gradient(180deg, rgba(0, 255, 247, 1) 0%, rgba(194, 237, 237, 1) 50%, rgba(255, 255, 255, 1) 66%, rgba(67, 255, 111, 1) 91%, rgba(0, 212, 49, 1) 100%);
  border: 3px solid var(--navy);
  padding: clamp(16px, 3vw, 24px);
}

.box3 {
  max-width: 940px;
  margin: 24px 0;
  background: #fff;
  border: 3px solid var(--navy);
  padding: clamp(16px, 3vw, 24px);
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.auth-form label {
  display: grid;
  gap: 4px;
  font-weight: bold;
}
.auth-form input {
  font: inherit;
  font-size: 17px;
  padding: 8px 10px;
  border: 2px solid var(--navy);
}
.form-status {
  min-height: 1.4em;
  margin: 0;
  color: var(--navy);
  text-align: center;
}
.switch { font-weight: normal; font-size: 16px; margin-top: 12px; }

footer {
  margin-top: auto;
  color: #fff;
  #background-image: linear-gradient(35deg, #000f8c 25%, #001d9c 25%, #001d9c 50%, #000f8c 50%, #000f8c 75%, #001d9c 75%, #001d9c 100%);
  background: #08007A;
  background-size: 69.74px 48.83px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 16px clamp(14px, 3vw, 28px);
}
footer p {
  margin: 0;
  color: #fff;
  font-size: 20px;
  text-shadow: 2px 2px 2px #000;
}
footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}
footer a { color: #fff; font-size: 16px; text-decoration: none; }
footer a:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .menu-toggle { display: inline-block; }
  .auth { margin-left: 0; }
  .topbar .ver { display: none; }
  .logo { font-size: 36px; }
  .shell { flex-direction: column; }
  .sidebar {
    display: none;
    width: 100%;
    align-self: auto;
  }
  .sidebar.open { display: block; }
  .sidebar a { font-size: 20px; padding: 10px 14px; }
  .content { max-width: none; }
  .links-row a { display: inline-block; margin: 4px 10px; }
  footer .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  .topbar { height: auto; padding: 8px 10px; flex-wrap: wrap; }
  .logo { font-size: 30px; }
  .btn { min-width: 0; padding: 6px 10px; font-size: 15px; }
  .auth { gap: 6px; }
}

.btn-small {
  min-width: 0;
  padding: 4px 12px;
  font-size: 15px;
}
.status {
  font-size: 15px;
  font-weight: bold;
  color: var(--navy);
}

.gallery {
  max-width: 420px;
  margin: 28px auto 0;
}
.gallery h2 { text-align: center; }

.slides {
  background: #000;
  border: 3px solid var(--navy);
  line-height: 0;
}
.slide { display: none; margin: 0; }
.slide.is-active { display: block; }
.slide img { display: block; width: 100%; height: auto; }

.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.dots {
  display: flex;
  gap: 8px;
}
.dot {
  width: 14px;
  height: 14px;
  padding: 0;
  border: 2px solid var(--navy);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}
.dot[aria-current="true"] { background: var(--yellow); }

#back-to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  display: none;
}
#back-to-top.show { display: inline-block; }

.content img {
  max-width: 100%;
  height: auto;
}
.slide img {
  max-height: 240px;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  object-fit: contain;
}
.gallery-controls .btn,
.dots {
  flex: 0 0 auto;
}
#back-to-top {
  left: auto;
  width: auto;
  min-width: 120px;
}
