/* BeaverBoy Online: a hand-drawn, comic-panel look in the game's own colours and fonts. */

@font-face {
  font-family: "Mochiy Pop One";
  src: url("fonts/mochiy-pop-one.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Patrick Hand";
  src: url("fonts/patrick-hand.woff2") format("woff2");
  font-display: swap;
}

:root {
  --sky: #a6dbf7;
  --sky-deep: #7cc4ee;
  --paper: #fdf6e6;
  --paper-2: #f6ead0;
  --card: #fffaf0;
  --ink: #2b2118;
  --ink-soft: #5c4a3a;
  --brown: #8b4a1c;
  --red: #e2463f;
  --red-dark: #b7302a;
  --yellow: #ffd84d;
  --grass: #7bc862;
  --soil: #b7865a;
  --line: 3px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --radius: 18px;
  --display: "Mochiy Pop One", "Hiragino Maru Gothic ProN", "Arial Rounded MT Bold", system-ui, sans-serif;
  --hand: "Patrick Hand", "Comic Sans MS", "Chalkboard SE", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1f1a24;
    --paper-2: #27212e;
    --card: #2e2735;
    --ink: #f4ead8;
    --ink-soft: #cbbfae;
    --sky: #1d3550;
    --sky-deep: #16283d;
    --brown: #f0a868;
    --grass: #3f7a36;
    --soil: #5a4232;
    --shadow: 5px 5px 0 #0c0a0e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1f1a24;
  --paper-2: #27212e;
  --card: #2e2735;
  --ink: #f4ead8;
  --ink-soft: #cbbfae;
  --sky: #1d3550;
  --sky-deep: #16283d;
  --brown: #f0a868;
  --grass: #3f7a36;
  --soil: #5a4232;
  --shadow: 5px 5px 0 #0c0a0e;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--hand);
  font-size: 1.25rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brown); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px dashed var(--red); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.15; margin: 0 0 .5em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); color: var(--brown); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.small { font-size: 1.05rem; }
.muted { color: var(--ink-soft); }
.center { text-align: center; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--yellow); color: #2b2118; padding: 8px 14px; border: var(--line); border-radius: 10px; z-index: 100; }
.skip:focus { left: 8px; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: var(--line);
}
.top-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-size: 1.15rem; }
.brand img { border-radius: 10px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nav a { text-decoration: none; color: var(--ink); padding: 6px 12px; border-radius: 999px; }
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav .nav-cta { background: var(--red); color: #fff; border: var(--line); box-shadow: 3px 3px 0 var(--ink); font-family: var(--display); font-size: 1rem; }
.nav .nav-cta:hover { background: var(--red-dark); color: #fff; }
.menu-button { display: none; }

@media (max-width: 760px) {
  .menu-button {
    display: block; margin-left: auto;
    font: inherit; font-size: 1.1rem; color: var(--ink);
    background: var(--card); border: var(--line); border-radius: 12px; padding: 4px 14px; cursor: pointer;
  }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: var(--line); padding: 8px 16px 16px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 10px 12px; }
  .nav .nav-cta { text-align: center; margin-top: 8px; }
}

/* Buttons */
.button {
  display: inline-block;
  font-family: var(--display); font-size: 1rem; text-decoration: none;
  color: var(--ink); background: var(--card);
  border: var(--line); border-radius: 14px; box-shadow: 4px 4px 0 var(--ink);
  padding: 10px 20px;
  transition: transform .08s ease, box-shadow .08s ease;
}
.button:hover { color: var(--ink); transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.button:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.button.primary { background: var(--red); color: #fff; }
.button.primary:hover { background: var(--red-dark); color: #fff; }
.button.big { font-size: 1.15rem; padding: 14px 26px; }

/* Panels: a comic frame around pictures */
.panel { margin: 0; background: var(--card); border: var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel figcaption { padding: 8px 14px; border-top: var(--line); font-size: 1.05rem; color: var(--ink-soft); }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--sky-deep) 0%, var(--sky) 70%);
  padding: clamp(32px, 6vw, 72px) 0 0;
}
.hero-inner { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(24px, 4vw, 56px); align-items: center; padding-bottom: 56px; }
.kicker { display: inline-block; font-family: var(--display); font-size: .95rem; background: var(--yellow); color: #2b2118; border: var(--line); border-radius: 999px; padding: 2px 14px; margin-bottom: 14px; }
.logo {
  font-size: clamp(2.8rem, 7vw, 5rem);
  color: #8b4a1c;
  -webkit-text-stroke: 10px #fffaf0;
  paint-order: stroke fill;
  text-shadow: 5px 6px 0 rgba(43, 33, 24, .25);
  margin-bottom: 18px;
}
.lede { font-size: 1.4rem; max-width: 34ch; }
.hero .lede, .hero .small { color: #2b2118; }
:root[data-theme="dark"] .hero .lede, :root[data-theme="dark"] .hero .small { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero .lede, :root:not([data-theme="light"]) .hero .small { color: var(--ink); } }
.cta { display: flex; flex-wrap: wrap; gap: 14px; margin: 22px 0 14px; }
.tilt { transform: rotate(1.5deg); }
.hero-shot img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }

.ground {
  position: relative; z-index: 1; height: 44px;
  background: linear-gradient(var(--grass) 0 18px, var(--soil) 18px);
  border-top: var(--line);
}
.clouds i {
  position: absolute; z-index: 0; display: block;
  width: 180px; height: 56px; background: #fff; border-radius: 999px; opacity: .9;
  animation: drift 60s linear infinite;
}
.clouds i::before, .clouds i::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.clouds i::before { width: 80px; height: 80px; left: 28px; top: -40px; }
.clouds i::after { width: 60px; height: 60px; left: 90px; top: -26px; }
.clouds i:nth-child(1) { top: 70px; left: -10%; }
.clouds i:nth-child(2) { top: 180px; left: 40%; transform: scale(.7); animation-duration: 80s; animation-delay: -30s; }
.clouds i:nth-child(3) { top: 40px; left: 75%; transform: scale(.85); animation-duration: 70s; animation-delay: -50s; }
:root[data-theme="dark"] .clouds i, :root[data-theme="dark"] .clouds i::before, :root[data-theme="dark"] .clouds i::after { background: #2c4766; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .clouds i, :root:not([data-theme="light"]) .clouds i::before, :root:not([data-theme="light"]) .clouds i::after { background: #2c4766; }
}
@keyframes drift { from { translate: -20vw 0; } to { translate: 120vw 0; } }
@media (prefers-reduced-motion: reduce) { .clouds i { animation: none; } }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .tilt { transform: none; }
}

/* Sections */
.section { padding: clamp(48px, 8vw, 96px) 0; }
.section.alt { background: var(--paper-2); border-block: var(--line); }
.intro { font-size: 1.35rem; max-width: 60ch; }
.note { font-size: 1.15rem; background: var(--card); border: 2px dashed var(--ink-soft); border-radius: 14px; padding: 10px 16px; display: inline-block; }
.split { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.split.reverse { grid-template-columns: 1.4fr .6fr; }
@media (max-width: 860px) { .split, .split.reverse { grid-template-columns: 1fr; } }

.stats { list-style: none; padding: 0; margin: 0 0 1em; display: grid; gap: 6px; }
.stats li { display: grid; grid-template-columns: 3.6em 1fr; align-items: baseline; }
.stats b { font-family: var(--display); font-weight: 400; color: var(--brown); }

/* Gallery */
.group { margin: 40px 0 16px; color: var(--ink); }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.gallery.two { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .gallery, .gallery.two { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .gallery, .gallery.two { grid-template-columns: 1fr; } }
.shot {
  display: block; text-decoration: none; color: var(--ink);
  background: var(--card); border: var(--line); border-radius: 14px; box-shadow: 4px 4px 0 var(--ink); overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease;
}
.shot:hover { color: var(--ink); transform: translate(-2px, -2px) rotate(-.5deg); box-shadow: 6px 6px 0 var(--ink); }
.shot img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; border-bottom: var(--line); }
.shot span { display: block; padding: 6px 12px; font-family: var(--display); font-size: .95rem; }

.bosses { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin: 36px 0 20px; }
.bosses figure { margin: 0; text-align: center; }
.bosses img { height: 110px; width: auto; max-width: 100%; object-fit: contain; margin: 0 auto 8px; filter: drop-shadow(3px 3px 0 rgba(43, 33, 24, .25)); }
.bosses figcaption { font-size: 1rem; line-height: 1.25; color: var(--ink-soft); }
.bosses b { display: block; font-family: var(--display); font-weight: 400; font-size: .9rem; color: var(--ink); margin-bottom: 2px; }
@media (max-width: 520px) { .bosses { grid-template-columns: repeat(2, 1fr); } }

/* Gadgets */
.gadgets { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.gadgets li {
  display: grid; grid-template-columns: 72px 1fr; grid-template-rows: auto 1fr; column-gap: 14px; align-items: start;
  background: var(--card); border: var(--line); border-radius: 16px; box-shadow: 4px 4px 0 var(--ink); padding: 14px;
}
.gadgets img { grid-row: span 2; width: 72px; height: 72px; object-fit: contain; background: var(--paper-2); border-radius: 12px; padding: 6px; }
.gadgets b { font-family: var(--display); font-weight: 400; font-size: 1rem; }
.gadgets span { font-size: 1.1rem; line-height: 1.35; color: var(--ink-soft); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 24px; }
@media (max-width: 900px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }
.card { background: var(--card); border: var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card > img { height: 64px; width: auto; object-fit: contain; margin-bottom: 12px; }
.card p:last-child { margin-bottom: 0; }

.star-figure { margin: 0; display: grid; place-items: center; }
.star-figure img { width: min(200px, 60%); animation: bob 3s ease-in-out infinite; filter: drop-shadow(4px 6px 0 rgba(43, 33, 24, .25)); }
@keyframes bob { 50% { translate: 0 -12px; rotate: 6deg; } }
@media (prefers-reduced-motion: reduce) { .star-figure img { animation: none; } }

/* Downloads */
.downloads { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 28px 0 20px; }
@media (max-width: 680px) { .downloads { grid-template-columns: 1fr; } }
.download h3 { font-size: 1.6rem; }
.download.suggested { outline: 4px solid var(--yellow); outline-offset: 4px; }
.download .button { margin: 6px 0 14px; }

/* FAQ */
details { background: var(--card); border: var(--line); border-radius: 14px; margin-bottom: 14px; box-shadow: 3px 3px 0 var(--ink); }
summary { cursor: pointer; padding: 12px 18px; font-family: var(--display); font-size: 1rem; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.3rem; line-height: 1; }
details[open] summary::after { content: "–"; }
details p { padding: 0 18px 4px; }
.contact { margin-top: 28px; }

/* Footer */
.foot { background: #2b2118; color: #fdf6e6; padding: 32px 0; }
:root[data-theme="dark"] .foot { background: #141016; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .foot { background: #141016; } }
.foot a { color: var(--yellow); }
.foot-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.foot-inner p { margin: 0; }
.foot-inner img { border-radius: 12px; }

/* Lightbox */
.lightbox { padding: 0; border: var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); max-width: min(1280px, 94vw); box-shadow: var(--shadow); }
.lightbox::backdrop { background: rgba(20, 14, 10, .75); }
.lightbox img { width: 100%; height: auto; }
.lightbox p { margin: 0; padding: 10px 16px; }
.lightbox .close {
  position: absolute; top: 10px; right: 10px;
  width: 44px; height: 44px; font-size: 1.8rem; line-height: 1; cursor: pointer;
  background: var(--card); color: var(--ink); border: var(--line); border-radius: 50%;
}

/* Text pages (privacy, terms, thanks) */
.page { padding: clamp(32px, 6vw, 72px) 0; }
.page h1 { font-size: clamp(2rem, 5vw, 3rem); color: var(--brown); }
.page h2 { font-size: 1.5rem; margin-top: 1.6em; }
.page li { margin-bottom: .4em; }
.thanks { text-align: center; }
.thanks img { margin: 0 auto 20px; width: 160px; }

/* Account page (account.html): log in and see your characters. */
.small-button { font-size: .9rem; padding: 6px 14px; }
.narrow-card { width: min(460px, 100%); margin: 0 auto; }
.login-form { display: grid; gap: 14px; }
.login-form label { display: grid; gap: 4px; font-size: 1.1rem; }
.login-form input {
  font: inherit; font-size: 1.15rem; color: var(--ink); background: var(--paper);
  border: var(--line); border-radius: 12px; padding: 8px 12px;
}
.login-form .error { color: var(--red); min-height: 1.4em; margin: 0; }
.me-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 8px; margin-bottom: 18px; }
.me-head h1 { margin: 0; }
.empty-note { font-size: 1.3rem; }
#characters { display: grid; gap: 28px; }
.character { display: grid; gap: 18px; }
.char-top { display: grid; grid-template-columns: 170px 1fr; gap: 20px; align-items: center; }
@media (max-width: 560px) { .char-top { grid-template-columns: 1fr; justify-items: start; } }
.char-id h2 { margin: 0 0 4px; font-size: 1.8rem; color: var(--brown); }
.char-id p { margin: 0 0 6px; }
.guild { font-family: var(--display); font-size: .95rem; color: var(--ink-soft); }
.meters { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; max-width: 420px; margin: 10px 0; font-size: 1.05rem; }
.bar { height: 12px; background: var(--paper-2); border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--red); }
.meters .bar:last-child .bar-fill { background: var(--yellow); }
.money { font-size: 1.2rem; }

/* The portrait: the character art, with their colour multiplied onto the tintable parts. */
.portrait { position: relative; width: 160px; aspect-ratio: 1; background: var(--sky); border: var(--line); border-radius: 50%; overflow: hidden; }
.portrait img, .portrait-tint { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.portrait-tint {
  background: var(--tint);
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  mix-blend-mode: multiply;
}

.char-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 24px; }
@media (max-width: 760px) { .char-grid { grid-template-columns: 1fr; } }
.character h3 { font-size: 1.05rem; margin: 14px 0 8px; }
.character h3:first-child { margin-top: 0; }
.stat-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, auto); gap: 4px 14px; justify-content: start; }
.stat-list b { font-family: var(--display); font-weight: 400; color: var(--brown); margin-right: 6px; }
.gear-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.gear-list li { display: grid; grid-template-columns: 70px 1fr; align-items: center; }
.slot-label { color: var(--ink-soft); }
.gear { display: inline-flex; align-items: center; gap: 6px; }
.gear img { width: 28px; height: 28px; object-fit: contain; }
.bag { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, 52px); gap: 6px; }
.item { position: relative; width: 52px; height: 52px; background: var(--paper-2); border: 2px solid var(--ink-soft); border-radius: 10px; display: grid; place-items: center; }
.item img { width: 38px; height: 38px; object-fit: contain; }
.item .count { position: absolute; right: 3px; bottom: 0; font-size: .9rem; line-height: 1; }
.quests { padding-left: 1.2em; margin: 0; }
.quests li { margin-bottom: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.stat-list li { font-size: 1.3rem; }
.stat-list b { font-size: 1rem; }
.gear-list { gap: 2px; }

.booth-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 24px 0 8px; max-width: 640px; }
.booth-row figure { margin: 0; text-align: center; }
.booth-row img { height: 130px; width: auto; margin: 0 auto 8px; object-fit: contain; filter: drop-shadow(3px 3px 0 rgba(43, 33, 24, .25)); }
.booth-row figcaption { font-size: 1rem; color: var(--ink-soft); line-height: 1.25; }
.booth-row b { display: block; font-family: var(--display); font-weight: 400; font-size: .9rem; color: var(--ink); }

.rep-section { grid-column: 1 / -1; }
.rep-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.rep-list li { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(130px, 1fr) 2fr; gap: 12px; align-items: center; }
@media (max-width: 560px) { .rep-list li { grid-template-columns: 1fr 1fr; } .rep-list .bar, .rep-list li > .muted { grid-column: 1 / -1; } }
.rep-rank { font-family: var(--display); font-size: .95rem; }
.title-badge { font-family: var(--display); font-size: .85rem; color: var(--brown); background: var(--yellow); color: #2b2118; border-radius: 999px; padding: 1px 10px; margin-left: 8px; }
.friend { color: #c4446f; font-family: var(--display); margin: 0; }
/* Mounts: a row of icons with names. */
.mount-row { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.mount-row li { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-family: var(--display); font-size: .9rem; }
.mount-row img { width: 72px; height: 72px; object-fit: contain; background: var(--paper-2); border-radius: 12px; padding: 6px; }
@media (max-width: 520px) { .mount-row { grid-template-columns: repeat(2, 1fr); } }
#together .gallery { margin-top: 28px; }
#mounts .shot { align-self: center; }
