/* ROCK ON: the look of the game pages (About, My rocks, Battle arena, Trading post).
   It is taken from the animated rocks themselves: one thick dark outline round everything, a hard shadow straight underneath
   (no blur, as if cut out and stuck down), fat rounded corners, flat colours, and chunky rounded lettering.
   Loaded after each page's own styles and before the phone layout (rockapp.css). Everything is under body.rk, so the rest of
   the site and the top menu keep Sola's own style. */
body.rk {
  --rk-ink: #131116;        /* the outline and the shadow, the same near-black the rocks are drawn with */
  --rk-rim: #50515e;        /* the lighter edge that lets a dark slab show on a dark page */
  --rk-slab: #25252d;       /* panels */
  --rk-slab2: #31323d;      /* raised bits on a panel */
  --rk-cream: #f5f1e6;      /* lettering */
  --rk-disp: "Lilita One", "Exo 2", system-ui, sans-serif;
  --panel: var(--rk-slab); --panel2: var(--rk-slab2); --line: var(--rk-rim);
}

/* ---------- lettering ---------- */
body.rk h1, body.rk h2, body.rk h3 { font-family: var(--rk-disp); font-style: normal; font-weight: 400; letter-spacing: .4px; }
body.rk .pagehead h1, body.rk .prof h1, body.rk h2.sec, body.rk .needin h2 {
  color: var(--rk-cream); -webkit-text-stroke: .16em var(--rk-ink); paint-order: stroke fill; text-shadow: 0 .09em 0 var(--rk-ink);
}
/* page titles (Battle Arena, Trading Post): a plain slab of the logo's rock with the words cut into it and the last word in the logo's red.
   No cracks, no crumbs, no villager: the logo stays the fancy one. */
body.rk .pagehead h1:not(.ronh) {
  display: inline-block; font-family: "Titan One", var(--rk-disp); font-size: clamp(30px, 4.4vw, 46px); line-height: 1; letter-spacing: .6px; text-transform: uppercase;
  color: #3a3a43; -webkit-text-stroke: 0; text-shadow: 2px 3px 0 #e4e4ea; padding: .3em .62em .2em; margin: 0 0 20px -2px; transform: rotate(-1deg);
  background: radial-gradient(circle at 12% 30%, #00000014 0 3px, transparent 4px), radial-gradient(circle at 78% 66%, #00000014 0 4px, transparent 5px), radial-gradient(circle at 46% 20%, #ffffff26 0 2px, transparent 3px), linear-gradient(180deg, #bcbcc5, #80808b);
  border: 4px solid var(--rk-ink); border-radius: 9px 16px 8px 14px / 14px 8px 16px 9px;
  box-shadow: inset 0 5px 0 #ffffff47, inset 0 -7px 0 #0000002e, 0 7px 0 var(--rk-ink);
}
body.rk .pagehead h1:not(.ronh) span { color: #d3202a; }
body.rk .pagehead h1:not(.ronh) + .rule { display: none; }
body.rk h2.sec { font-size: 30px; margin-top: 42px; }
body.rk h2.sec small, body.rk h1 small { -webkit-text-stroke: 0; text-shadow: none; }
body.rk .rule { height: 6px; width: 74px; border-radius: 6px; border: 2px solid var(--rk-ink); box-sizing: content-box; }

/* ---------- the logo: a cracked slab with ROCK ON chiselled into it, and today's villager looking over the top ---------- */
.ron { display: block; position: relative; aspect-ratio: 865 / 487; width: 190px; text-decoration: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.ron img { position: absolute; left: 0; top: 30.39%; width: 100%; height: 69.61%; display: block; z-index: 1; pointer-events: none; }
.ron canvas { position: absolute; left: 12.95%; top: -6%; width: 32.37%; height: 57.49%; z-index: 0; }
/* the slab in pieces (built by rockon.js): the ROCK half, the ON half and the crumbs. Whole: the ON half sits against the ROCK half
   with a crack between them. Point at the ON and it breaks off, drops and stays there. */
.ron img.r { z-index: 2; transform-origin: 78.84% 38.94%; transform: rotate(9deg) translate(2.31%, 10.03%); }
.ron img.c { z-index: 3; }
.ron .hit { position: absolute; right: 0; bottom: 0; width: 40%; height: 70%; z-index: 4; }
.ron.whole img.r { transform: rotate(0deg) translate(-1.85%, 0%); }
.ron.whole img.c { opacity: 0; }
.ron.breaking img.r { animation: ronBreak .9s cubic-bezier(.3, .1, .3, 1) both; }
.ron.breaking img.c { animation: ronCrumbs .45s .38s both; }
@keyframes ronBreak {
  0% { transform: rotate(0deg) translate(-1.85%, 0%); } 9% { transform: rotate(-1.4deg) translate(-1.85%, 0%); } 18% { transform: rotate(1.4deg) translate(-1.5%, 0%); } 27% { transform: rotate(-1deg) translate(-1.7%, .4%); } 36% { transform: rotate(.8deg) translate(-1.2%, .6%); }
  68% { transform: rotate(11.5deg) translate(2.7%, 12.5%); } 82% { transform: rotate(7.8deg) translate(2.1%, 8.6%); } 92% { transform: rotate(9.6deg) translate(2.4%, 10.6%); } 100% { transform: rotate(9deg) translate(2.31%, 10.03%); }
}
@keyframes ronCrumbs { 0% { opacity: 0; transform: translateY(-9%) scale(.92); } 60% { opacity: 1; transform: translateY(2%); } 100% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ron.breaking img.r, .ron.breaking img.c { animation: none; } }
.ron.big { width: min(600px, 100%); margin: 6px 0 22px -6px; }
.ron.mid { width: min(340px, 86%); margin: 0 0 12px -4px; }
body.rk h1.ronh, h2.ronh { line-height: 1; margin: 0; }
/* the header row: logo, then the four tabs, on one line */
/* On the game pages the logo sits inside the tab bar with the tabs. There it is the slab, and the villager looks over the top
   of it and out of the bar. */
.ron.sm { aspect-ratio: 865 / 339; }
.ron.sm img { top: 0; height: 100%; }
.ron.sm canvas { top: -58%; height: 82.6%; }
.ron.ph { display: none; }      /* phones: the tabs go along the bottom, so the logo gets a line of its own at the top */
body.rk .subnav.rkbar { align-items: center; overflow: visible; }
body.rk .subnav.rkbar a.ron.sm { flex: none; width: 232px; margin: -4px 12px -8px 2px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
/* the tabs in that bar: the words on two lines, big. No icons here (they stay on the phone's bottom tabs). */
@media (min-width: 761px) {
  body.rk .wrap > .subnav.rkbar a:not(.ron) { position: relative; display: grid; place-items: center; min-width: 108px; padding: 9px 18px; font-size: 20px; line-height: 1.02; text-align: center; }
  body.rk .wrap > .subnav.rkbar a:not(.ron) .s0i { display: none; }
  body.rk .wrap > .subnav.rkbar a:not(.ron) .s0bdg { position: absolute; top: 3px; right: 3px; margin: 0; }
}
@media (min-width: 761px) and (max-width: 1000px) { body.rk .subnav.rkbar a.ron.sm { width: 176px; margin-right: 4px; } body.rk .wrap > .subnav.rkbar a:not(.ron) { min-width: 0; padding: 8px 12px; font-size: 17px; } body.rk .wrap > .subnav.rkbar { flex-wrap: nowrap; } }
@media (min-width: 761px) { body.rk .wrap > .subnav.rkbar { margin-top: 62px !important; padding: 10px 12px; } body.rk .wrap > .subnav.rkbar a.ron.sm, body.rk .wrap > .subnav.rkbar a.ron.sm:hover { padding: 0; border: 0; background: none; box-shadow: none; } }

/* ---------- the four tabs ---------- */
@media (min-width: 761px) {
  body.rk .wrap > .subnav { padding: 6px; gap: 6px; border-radius: 18px; background: var(--rk-slab); border: 3px solid var(--rk-rim); box-shadow: 0 5px 0 var(--rk-ink); }
  body.rk .wrap > .subnav a { font: 400 16px/1.15 var(--rk-disp); letter-spacing: .3px; padding: 9px 16px; border-radius: 12px; border: 3px solid transparent; color: #b9bac4; }
  body.rk .wrap > .subnav a:hover { background: var(--rk-slab2); color: #fff; }
  body.rk .wrap > .subnav a.on { background: var(--red, #e3262f); color: #fff; border-color: var(--rk-ink); box-shadow: 0 3px 0 var(--rk-ink); }
}

/* ---------- slabs: every panel, card and box ---------- */
body.rk :is(.step, .path, .card, .prof, .needin, .idea, .team, .lb, .tcard, .offer, .abat, .ardy, .fopts, .closet, .rules details, .feed div, .mrock, .cust, .opt, .event, .shut, .arenaw) {
  border-width: 3px; border-style: solid; border-color: var(--rk-rim); border-radius: 18px; box-shadow: 0 5px 0 var(--rk-ink);
}
body.rk .card { background: var(--rk-slab); transition: transform .1s, box-shadow .1s, border-color .1s; }
body.rk .card[data-id]:hover, body.rk a.card:hover { transform: translateY(-3px); box-shadow: 0 8px 0 var(--rk-ink); border-color: #7b7c8a; }
body.rk .card[data-id]:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--rk-ink); }
body.rk .prof { background: var(--rk-slab); }
body.rk :is(.stat, .crumbs b, .medals span, .vsme) { border-width: 3px; border-radius: 14px; box-shadow: 0 3px 0 var(--rk-ink); }
body.rk .stat { border-color: var(--rk-rim); }
body.rk .stat b, body.rk .lbr .num, body.rk .lbr .rk, body.rk .step .no, body.rk .fx { font-family: var(--rk-disp); font-style: normal; font-weight: 400; }
body.rk .step .no { font-size: 26px; -webkit-text-stroke: .2em var(--rk-ink); paint-order: stroke fill; }
body.rk .rules summary, body.rk .slothead, body.rk .event b { font-family: var(--rk-disp); font-style: normal; font-weight: 400; letter-spacing: .4px; }

/* ---------- buttons: flat, outlined, and they press down ---------- */
body.rk :is(.wrap, .modal) :is(.btn, .cuopts button, .stance button, .wear button, #viewBtn) {
  font-family: var(--rk-disp); font-weight: 400; letter-spacing: .3px; border: 3px solid var(--rk-ink); border-radius: 14px;
  box-shadow: 0 0 0 2px #ffffff1c, 0 5px 0 2px var(--rk-ink); transition: transform .08s, box-shadow .08s, filter .08s;
}
body.rk :is(.wrap, .modal) .btn { background: var(--rk-slab2); color: var(--rk-cream); padding: 10px 18px; }
body.rk :is(.wrap, .modal) .btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
body.rk :is(.wrap, .modal) :is(.btn, .cuopts button, .stance button, .wear button):active { transform: translateY(3px); box-shadow: 0 0 0 2px #ffffff1c, 0 2px 0 2px var(--rk-ink); }
body.rk :is(.wrap, .modal) .btn.red { background: #e3262f; color: #fff; }
body.rk :is(.wrap, .modal) .btn.ghost { background: transparent; }
body.rk :is(.wrap, .modal) .btn.sm { padding: 6px 12px; font-size: 14px; border-radius: 12px; }
body.rk :is(.wrap, .modal) .btn.tw { background: #9146ff; } body.rk :is(.wrap, .modal) .btn.dc { background: #5865f2; }
body.rk :is(.wrap, .modal) :is(.cuopts button, .stance button, .wear button) { border-radius: 12px; box-shadow: 0 3px 0 var(--rk-ink); }
body.rk .modal .box { border: 3px solid var(--rk-rim); border-radius: 20px; box-shadow: 0 8px 0 var(--rk-ink); }
body.rk input[type=checkbox] { accent-color: #e3262f; }

/* ---------- phones: the logo sits on its own line above the page, the tabs stay along the bottom ---------- */
@media (max-width: 760px) {
  body.rk .subnav.rkbar a.ron.sm { display: none; }
  body.rk .subnav.rkbar a .tl br { display: none; }      /* phones: one line under the icon, as before */
  html:not(.embed) body.rk .wrap > .ron.ph { display: block; width: 210px; margin: 14px auto 4px; }
  body.rk .pagehead h1:not(.ronh) { font-size: 24px; border-width: 3px; box-shadow: inset 0 3px 0 #ffffff47, inset 0 -4px 0 #0000002e, 0 5px 0 var(--rk-ink); }
  .ron.big { display: none; }
  body.rk h2.sec { font-size: 22px; margin-top: 26px; }
  body.rk :is(.step, .path, .card, .prof, .needin, .idea, .team, .lb, .tcard, .offer, .abat, .ardy, .fopts, .closet, .rules details, .feed div, .mrock, .cust, .opt, .event, .shut, .arenaw) { border-radius: 14px; box-shadow: 0 4px 0 var(--rk-ink); }
}
@media (prefers-reduced-motion: reduce) { body.rk .card, body.rk .btn { transition: none; } }
