/* ---------- 互動教學 (guide.html, js/guide.js) ---------- */
.guide-head { border-top: 0; padding-bottom: 12px; }
.guide-head .lead { margin: 0; font-size: 15.5px; }
.guide-head .tag { margin: 0 0 4px; }

/* Every tutorial, one section per group (window.TomoTopics) */
.guide-group { padding-top: 18px; }
.guide-group-title { margin: 0 0 12px; font: 17.5px var(--font-pixel); color: var(--heading); }
.guide-group .guide-cards { padding-bottom: 6px; }
.guide-cards { display: grid; gap: 14px; padding-bottom: 48px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.guide-card {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; color: var(--text); text-decoration: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
}
.guide-card:hover { border-color: var(--teal-500); }
.guide-card img { flex: none; width: 32px; height: 32px; image-rendering: pixelated; }
.guide-card h3 { margin: 0; font-size: 16.5px; color: var(--heading); }
.guide-card h3::after { content: " ›"; color: var(--accent-soft); }
.guide-card .meta { margin: 2px 0 6px; font-size: 12.5px; color: var(--muted); }
.guide-card p { margin: 0; font-size: 13.5px; }

/* One tutorial: the box on the left, the steps on the right */
.guide { display: grid; grid-template-columns: minmax(0, 3fr) minmax(240px, 2fr); gap: 22px; align-items: start; }
@media (max-width: 820px) { .guide { grid-template-columns: 1fr; } }

/* ---- the game box ---- */
.gg {
  position: relative; overflow: hidden; outline: none; user-select: none; -webkit-user-select: none; touch-action: manipulation;
  -webkit-touch-callout: none; /* press and hold = right click, not the phone's popup */
  aspect-ratio: var(--cols) / var(--rows); background: #111; border-radius: 6px;
  box-shadow: 0 0 0 3px #1d1d1d, 0 0 0 5px #6b6b6b, 0 10px 30px rgba(0, 0, 0, 0.35);
  --k: 2; /* GUI scale, like the game's */
  font: 15.5px var(--font-mono); color: #fff;
}
.gg:focus-visible { box-shadow: 0 0 0 3px #1d1d1d, 0 0 0 5px var(--gold), 0 10px 30px rgba(0, 0, 0, 0.35); }
@media (max-width: 560px) { .gg { --k: 1.5; font-size: 12.5px; } }
.gg-world { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--cols), 1fr); grid-template-rows: repeat(var(--rows), 1fr); }
.gg-tile {
  position: relative; cursor: pointer;
  background: #91bd59 center / 100% 100%; background-blend-mode: multiply; image-rendering: pixelated;
}
/* The block outline under the cursor, like in game */
.gg-tile:hover::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.55); }
.gg-tile.hit { animation: gg-hit 0.18s ease-out; }
@keyframes gg-hit { 50% { filter: brightness(1.35); } }
/* Skyblock: nothing under the island */
.gg-tile.void { background: transparent; cursor: default; }
.gg-tile.void:hover::after { content: none; }
.gg-deco { position: absolute; inset: 8%; background: center / contain no-repeat; image-rendering: pixelated; pointer-events: none; }
/* entity/chest/normal.png: the lid seen from above is the 14 x 14 square at (28, 0) */
.gg-deco.chest { inset: 6%; background-size: 457.1429% 457.1429%; background-position: 56% 0; }
/* A sign stuck on the front of a block (a second one on the other corner) */
.gg-mark.sign { z-index: 1; }
.gg-mark.sign .gg-deco { inset: 46% 4% -6% 46%; }
.gg-mark.sign2 .gg-deco { inset: 46% 46% -6% 4%; }
.gg-mark.sign .gg-label { top: 100%; translate: -50% 10%; padding: 0 4px; font-size: 11.5px; color: #fff; }
.gg-mark.sign2 .gg-label { translate: -50% 130%; }
/* A home or island teleport point */
.gg-mark.home { box-shadow: inset 0 0 0 3px #ffd23c; background: rgba(255, 210, 60, 0.25); animation: gg-made 0.5s ease-out; }
.gg-mark.home .gg-label { top: 100%; translate: -50% -20%; padding: 0 4px; font-size: 11.5px; }

/* Selection corners and areas (positioned in tiles) */
.gg-marks { position: absolute; inset: 0; pointer-events: none; }
.gg-mark, .gg-area {
  position: absolute;
  left: calc(100% * var(--c) / var(--cols)); top: calc(100% * var(--r) / var(--rows));
  width: calc(100% * var(--w) / var(--cols)); height: calc(100% * var(--h) / var(--rows));
}
.gg-mark.corner-a { box-shadow: inset 0 0 0 3px #ffaa00; background: rgba(255, 170, 0, 0.25); }
.gg-mark.corner-b { box-shadow: inset 0 0 0 3px #55ffff; background: rgba(85, 255, 255, 0.25); }
.gg-area.selection { background: rgba(255, 255, 255, 0.16); outline: 2px dashed rgba(255, 255, 255, 0.9); outline-offset: -2px; animation: gg-sel 1.2s steps(2) infinite; }
@keyframes gg-sel { 50% { outline-color: rgba(255, 220, 120, 0.9); } }
.gg-area.plot { background: rgba(255, 210, 60, 0.22); box-shadow: inset 0 0 0 3px #ffd23c; animation: gg-made 0.5s ease-out; }
@keyframes gg-made { from { box-shadow: inset 0 0 0 12px #fff; } }
.gg-label {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; padding: 1px 6px; white-space: nowrap;
  background: rgba(0, 0, 0, 0.5); color: #ffd23c; font-size: 13.5px;
}
/* Players: the skin's face with its hat layer on top (64 x 64 skin, face at 8,8 and hat at 40,8), name above */
.gg-player { z-index: 1; transition: left 0.4s linear, top 0.4s linear; }
.gg-head {
  position: absolute; inset: 16%; image-rendering: pixelated; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
  background-size: 800% 800%; background-position: 71.4286% 14.2857%, 14.2857% 14.2857%; background-repeat: no-repeat;
}
.gg-player .gg-label { top: 0; translate: -50% -85%; padding: 0 4px; color: #fff; font-size: 11.5px; }

/* HUD */
.gg-hint {
  position: absolute; left: 8px; top: 6px; right: 44px; padding: 2px 6px; font-size: 11.5px; pointer-events: none;
  background: rgba(0, 0, 0, 0.45); width: fit-content; max-width: calc(100% - 60px);
}
.gg-reset {
  position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; padding: 0; cursor: pointer;
  font: 17.5px var(--font-mono); color: #fff; background: #6b6b6b; border: 2px solid #000;
  box-shadow: inset 2px 2px 0 #a9a9a9, inset -2px -2px 0 #3f3f3f;
}
.gg-reset:hover { background: #7c84c4; }
.gg-sneak {
  position: absolute; right: 42px; top: 6px; height: 30px; padding: 0 8px; cursor: pointer;
  font: 13.5px var(--font-mono); color: #fff; background: #6b6b6b; border: 2px solid #000;
  box-shadow: inset 2px 2px 0 #a9a9a9, inset -2px -2px 0 #3f3f3f;
}
.gg-sneak[hidden] { display: none; }
.gg:has(.gg-sneak:not([hidden])) .gg-hint { max-width: calc(100% - 140px); }
.gg-sneak:hover { background: #7c84c4; }
.gg-sneak[aria-pressed="true"] { background: #3f6f3f; box-shadow: inset 2px 2px 0 #2a4a2a, inset -2px -2px 0 #6f9f6f; }
.gg-chat { position: absolute; left: 6px; bottom: calc(var(--k) * 22px + 12px); width: min(78%, 420px); pointer-events: none; }
.gg-chat .gg-input { pointer-events: auto; } /* the lines above let clicks through to the ground */
.gg-log { display: flex; flex-direction: column; }
.gg-line { padding: 1px 6px; background: rgba(0, 0, 0, 0.5); white-space: pre-wrap; text-shadow: 2px 2px 0 #3f3f3f; line-height: 1.35; }
.gg-input {
  display: block; width: 100%; margin-top: 3px; padding: 3px 6px; border: 0; outline: none;
  font: inherit; color: #fff; background: rgba(0, 0, 0, 0.55); caret-color: #fff;
}
.gg-input::placeholder { color: #bbb; }
.gg-line { transition: opacity 0.8s; }
.gg-line.old { opacity: 0; }
.gg-chat:has(.gg-input:focus) .gg-line.old { opacity: 1; }
.gg-input:focus { background: rgba(0, 0, 0, 0.75); }
/* The game's own hotbar sprite: 182 x 22, slots every 20 px */
.gg-hotbar {
  position: absolute; left: 50%; bottom: 6px; translate: -50% 0;
  width: calc(var(--k) * 182px); height: calc(var(--k) * 22px);
  background: 0 0 / 100% 100% no-repeat; image-rendering: pixelated;
}
.gg-slot {
  position: absolute; top: calc(var(--k) * 3px); left: calc(var(--k) * (3px + 20px * var(--i)));
  width: calc(var(--k) * 16px); height: calc(var(--k) * 16px); padding: 0; border: 0; cursor: pointer;
  background: transparent center / 100% no-repeat; image-rendering: pixelated;
}
.gg-pick {
  position: absolute; top: calc(var(--k) * -1px); left: calc(var(--k) * (-1px + 20px * var(--i, 0)));
  width: calc(var(--k) * 24px); height: calc(var(--k) * 23px);
  background: 0 0 / 100% 100% no-repeat; image-rendering: pixelated; pointer-events: none;
}

/* Done */
.gg-spark {
  z-index: 3;
  position: absolute; width: 16px; height: 16px; pointer-events: none;
  background: center / 100% no-repeat; image-rendering: pixelated; animation: gg-spark 0.9s ease-out forwards;
}
@keyframes gg-spark { from { opacity: 1; translate: 0 0; } to { opacity: 0; translate: 0 -40px; } }
.gg-end { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; background: rgba(0, 0, 0, 0.45); } /* above player heads */
.gg-end[hidden] { display: none; }
.gg-end-card {
  max-width: 80%; padding: 16px 20px; text-align: center; font-family: var(--font-body);
  background: rgba(20, 22, 40, 0.88); border: 2px solid #ffd23c; border-radius: 10px;
}
.gg-end-card b { font: 21.5px var(--font-pixel); color: #ffd23c; }
.gg-end-card p { margin: 8px 0 0; }
.gg-end-card code { color: #ffd23c; }

/* ---- the steps ---- */
.guide-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.guide-steps li { display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-items: stretch; }
.gs-n {
  display: grid; place-items: center; border-radius: 8px;
  font: 19.5px var(--font-mono); color: #3b2414; background: var(--gold);
}
.gs-t {
  padding: 10px 14px; border-radius: 10px; font-size: 14.5px; line-height: 1.55;
  background: var(--panel); border: 1px solid var(--line); transition: border-color 0.2s, opacity 0.2s;
}
.gs-t code, .gs-t kbd { font: 14.5px var(--font-mono); color: var(--accent); background: var(--code-bg); padding: 0 4px; border-radius: 4px; }
.guide-steps li.now .gs-t { border-color: var(--teal-500); box-shadow: 0 0 0 2px rgba(66, 150, 150, 0.3); }
.guide-steps li.done .gs-n { background: #5bd16a; color: transparent; position: relative; }
.guide-steps li.done .gs-n::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #10391a; }
.guide-steps li.done .gs-t { opacity: 0.6; }

/* ---- facing (t.facing): the turn control and an arrow on "you" ---- */
.gg-face {
  position: absolute; right: 6px; top: 42px; display: flex; align-items: center; gap: 4px;
  padding: 2px; background: rgba(0, 0, 0, 0.45); font-size: 12.5px;
}
.gg-face[hidden] { display: none; }
.gg-face-label { min-width: 3.2em; text-align: center; }
.gg-turn {
  width: 26px; height: 26px; padding: 0; cursor: pointer;
  font: 14.5px var(--font-mono); color: #fff; background: #6b6b6b; border: 2px solid #000;
  box-shadow: inset 2px 2px 0 #a9a9a9, inset -2px -2px 0 #3f3f3f;
}
.gg-turn:hover { background: #7c84c4; }
.gg[data-facing] .gg-mark[data-key="me"]::after {
  content: ""; position: absolute; left: 50%; top: -14%; translate: -50% 0; pointer-events: none;
  border: 7px solid transparent; border-bottom: 9px solid #ffd23c; border-top: 0;
  transform-origin: 50% 340%; filter: drop-shadow(0 0 1px #000);
}
.gg[data-facing="east"] .gg-mark[data-key="me"]::after { rotate: 90deg; }
.gg[data-facing="south"] .gg-mark[data-key="me"]::after { rotate: 180deg; }
.gg[data-facing="west"] .gg-mark[data-key="me"]::after { rotate: 270deg; }

/* ---- a container menu (game.menu), drawn like the game's chest GUI ---- */
.gg-menu { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: rgba(0, 0, 0, 0.4); }
.gg-menu[hidden] { display: none; }
.gg-menu-panel {
  position: relative; padding: calc(var(--k) * 6px) calc(var(--k) * 7px) calc(var(--k) * 7px);
  background: #c6c6c6; border-radius: 3px;
  box-shadow: 0 0 0 2px #000, inset 2px 2px 0 #fff, inset -2px -2px 0 #555;
}
.gg-menu-title { margin: 0 0 calc(var(--k) * 3px) 2px; font-size: 13.5px; line-height: 1.2; padding-right: 24px; }
.gg-menu-close {
  position: absolute; right: 4px; top: 3px; width: 20px; height: 20px; padding: 0; cursor: pointer;
  font: 14.5px var(--font-mono); line-height: 1; color: #404040; background: transparent; border: 0;
}
.gg-menu-close:hover { color: #000; }
/* A screen drawn with the game's own art (js/guide.js menu({ art })): slots and pictures at art pixels */
.gg-menu-panel.art {
  width: calc(var(--k) * var(--aw) * 1px); height: calc(var(--k) * var(--ah) * 1px); padding: 0; border-radius: 0;
  background: 0 0 / calc(var(--k) * 256px) no-repeat; box-shadow: none; image-rendering: pixelated;
}
.gg-menu-panel.art .gg-menu-title { position: absolute; left: calc(var(--k) * 8px); top: calc(var(--k) * 5px); margin: 0; }
.gg-menu-panel.art .gg-menu-grid { display: block; position: absolute; inset: 0; }
.gg-menu-panel.art .gg-menu-slot { position: absolute; left: calc(var(--k) * (var(--x) - 1) * 1px); top: calc(var(--k) * (var(--y) - 1) * 1px); background: none; box-shadow: none; }
.gg-menu-deco { position: absolute; left: calc(var(--k) * var(--x) * 1px); top: calc(var(--k) * var(--y) * 1px); width: calc(var(--k) * var(--w) * 1px); height: calc(var(--k) * var(--h) * 1px); background: 0 0 / 100% 100% no-repeat; image-rendering: pixelated; pointer-events: none; }
.gg-menu-grid { display: grid; grid-template-columns: repeat(9, calc(var(--k) * 18px)); }
.gg-menu-slot {
  position: relative; width: calc(var(--k) * 18px); height: calc(var(--k) * 18px);
  background: #8b8b8b; box-shadow: inset 1px 1px 0 #373737, inset -1px -1px 0 #fff;
}
.gg-menu-slot:has(.gg-menu-icon) { cursor: pointer; }
.gg-menu-icon { position: absolute; inset: calc(var(--k) * 1px); background: center / 100% no-repeat; image-rendering: pixelated; }
.gg-menu-slot:has(.gg-menu-icon):hover::after { content: ""; position: absolute; inset: 1px; background: rgba(255, 255, 255, 0.35); }
/* The enchantment shimmer of an allowed flag */
.gg-menu-slot.glint .gg-menu-icon::after {
  content: ""; position: absolute; inset: 0; mix-blend-mode: screen; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(190, 120, 255, 0.75) 48%, transparent 62%) 0 0 / 300% 300%;
  animation: gg-glint 2.4s linear infinite;
}
@keyframes gg-glint { from { background-position: 100% 100%; } to { background-position: 0 0; } }
/* The game's item tooltip */
.gg-tip {
  position: absolute; z-index: 4; max-width: 62%; padding: 4px 7px; pointer-events: none;
  font-size: 12.5px; line-height: 1.45; color: #fff; text-shadow: 1px 1px 0 #3f3f3f;
  background: rgba(16, 0, 16, 0.94); border: 2px solid #2d0a6a; border-radius: 3px;
}
.gg-tip[hidden] { display: none; }
.gg-tip-name { margin-bottom: 2px; }

/* ---- a dialog (game.dialog), like Paper's dialog screens: shop setup, parcel sending ---- */
.gg-dialog { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: rgba(0, 0, 0, 0.6); }
.gg-dialog[hidden] { display: none; }
.gg-dialog-box { width: min(86%, 360px); text-align: center; font-size: 13.5px; }
.gg-dialog-title { margin-bottom: 8px; font-size: 15.5px; text-shadow: 2px 2px 0 #3f3f3f; }
.gg-dialog-text { margin: 0 0 8px; line-height: 1.5; }
.gg-dialog-field { display: flex; align-items: center; gap: 8px; margin: 0 auto 8px; text-align: left; }
.gg-dialog-field span { flex: none; }
.gg-dialog-field input[type=text] {
  flex: 1; min-width: 0; padding: 4px 6px; font: inherit; color: #fff; caret-color: #fff;
  background: #000; border: 1px solid #a0a0a0; outline: none;
}
.gg-dialog-field input[type=text]:focus { border-color: #fff; }
.gg-dialog-field.check { justify-content: center; cursor: pointer; }
.gg-dialog-field input[type=checkbox] { width: 18px; height: 18px; accent-color: #5f5; cursor: pointer; }
.gg-dialog-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 4px; }
.gg-dialog-button {
  min-width: 100px; padding: 6px 10px; cursor: pointer; font: inherit; color: #fff;
  background: #6b6b6b; border: 2px solid #000; box-shadow: inset 2px 2px 0 #a9a9a9, inset -2px -2px 0 #3f3f3f;
}
.gg-dialog-button:hover { background: #7c84c4; }

/* ---- chat parts with a tooltip or a click ---- */
.gg-chat .gg-hover { pointer-events: auto; cursor: default; }
.gg-chat .gg-hover.click { cursor: pointer; }
.gg-chat .gg-hover:hover { text-decoration: underline; }
.gg-line.old .gg-hover { pointer-events: none; }


/* Group and topic links in headings read as headings, not as body links */
.guide-group-title a, .guide-head .tag a { color: inherit; text-decoration: none; }
.guide-group-title a:hover, .guide-head .tag a:hover { text-decoration: underline; }
.guide-group { scroll-margin-top: calc(var(--topbar-h, 64px) + 12px); }

/* ---------- 指令教學 (wiki.html, js/wiki.js) ---------- */
.wiki-sec { padding-top: 22px; scroll-margin-top: calc(var(--topbar-h, 64px) + 12px); }
.wiki-sec h2 { margin: 0; font: 21.5px var(--font-pixel); color: var(--heading); }
.wiki-sec h3 { margin: 18px 0 8px; font-size: 15.5px; color: var(--heading); }
.wiki-meta { margin: 4px 0 12px; font-size: 12.5px; color: var(--muted); }
.wiki-list { margin: 0 0 12px; padding-left: 20px; line-height: 1.7; }
.wiki-table { overflow-x: auto; margin: 0 0 12px; }
/* A long table that starts folded (js/wiki.js b.fold) */
.wiki-fold { margin: 0 0 12px; }
.wiki-fold > summary { cursor: pointer; width: fit-content; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--accent); }
.wiki-fold[open] > summary { margin-bottom: 8px; }
.wiki-table table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.wiki-table th, .wiki-table td { padding: 8px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.wiki-table th { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.wiki-table td:first-child { white-space: nowrap; }
.wiki-sec code { font: 13.5px var(--font-mono); color: var(--accent); background: var(--code-bg); padding: 0 4px; border-radius: 4px; }
.wiki-sec code.copy { cursor: copy; }
/* The command the chat or the search bar brought you to */
.wiki-sec code.hit { animation: wiki-hit 2.4s ease-out; }
@keyframes wiki-hit { 0%, 40% { background: var(--gold); color: #0e1716; box-shadow: 0 0 0 4px var(--gold); } }
.wiki-sec code.copy:hover, .wiki-sec code.copy:focus-visible { outline: 1px solid var(--accent); outline-offset: 1px; }
@media (max-width: 560px) { .wiki-table td:first-child { white-space: normal; } }

/* Wiki pictures: section icons, item rows and crafting grids drawn from the game's own textures */
.wiki-sec h2 { display: flex; align-items: center; gap: 10px; }
.wiki-ico { width: 32px; height: 32px; image-rendering: pixelated; flex: none; }
.wiki-row-ico { display: inline-block; width: 24px; height: 24px; margin: -3px 8px -3px 0; vertical-align: middle; image-rendering: pixelated; }
.wiki-slot {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  background: #8b8b8b; box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff;
}
.wiki-slot.big { width: 52px; height: 52px; }
.wiki-slot.big .wiki-ico { width: 40px; height: 40px; }
/* An in-game screen (js/wiki.js screen()): the menu art with item pictures in its slots */
.wiki-gui { margin: 4px 0 14px; }
.wiki-gui-art { position: relative; background: center / 100% 100% no-repeat; image-rendering: pixelated; container-type: inline-size; }
/* sized in art pixels: the game's text is 8 px tall, centred in the tab at the top */
.wiki-gui-title { position: absolute; left: 0; right: 0; top: calc(100cqw * 4 / var(--w)); text-align: center; color: #fff; font-size: calc(100cqw * 8 / var(--w)); line-height: 1.2; }
.wiki-gui-art img { position: absolute; image-rendering: pixelated; }
.wiki-recipe { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 4px 0 14px; }
.wiki-recipe figcaption { flex-basis: 100%; font-size: 12.5px; color: var(--muted); }
.wiki-grid { display: grid; grid-template-columns: repeat(3, 40px); gap: 2px; padding: 6px; background: #c6c6c6; border-radius: 4px; }
.wiki-arrow { font-size: 23.5px; color: var(--muted); }
.wiki-items { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 4px 0 14px; }
.wiki-item { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12.5px; }

/* ---------- 貨幣 / 階級 / 贊助 pages (js/store.js) ---------- */
.store-ico { width: 32px; height: 32px; image-rendering: pixelated; vertical-align: middle; flex: none; }
.store-name { display: flex; align-items: center; gap: 10px; white-space: nowrap; font-weight: 600; }
.store-table td { vertical-align: middle; white-space: nowrap; }
.store-table th, .store-table td { padding: 8px 10px; }
.coin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 16px; }
.coin-card { display: flex; gap: 16px; align-items: flex-start; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.coin-card.soon { opacity: 0.65; }
.coin-spin { width: 64px; height: 64px; flex: none; image-rendering: pixelated; }
.coin-card h3 { display: flex; align-items: center; gap: 8px; margin: 2px 0 4px; font-size: 17.5px; color: var(--heading); }
.coin-card .chip { margin: 0; font-size: 10.5px; }
.coin-type { margin: 0 0 6px; color: var(--gold-text); font-size: 13.5px; }
.coin-ways, .coin-note { margin: 2px 0; font-size: 13.5px; color: var(--muted); }

/* ---------- 社群 page (js/socials.js) ---------- */
.social-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.social-card {
  display: flex; gap: 16px; align-items: center; padding: 16px 18px; text-decoration: none; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
}
.social-card:hover { border-color: var(--teal-500); }
.social-card svg { width: 48px; height: 48px; flex: none; }
.social-card b { display: block; font-size: 17.5px; color: var(--heading); }
.social-note { display: block; font-size: 13.5px; color: var(--gold-text); }

/* ---------- 分流 page: the sky map and the server windows (servers.html, js/servers.js) ---------- */
.srv-map-block { padding-top: 8px; }
.srvmap {
  position: relative; aspect-ratio: 16 / 10; border-radius: 18px; overflow: hidden;
  background: linear-gradient(#78a7ff, #b5d1ff 70%, #d8e7ff);
}
:root[data-theme-now="dark"] .srvmap { background: linear-gradient(#060816, #10142c 70%, #1a2040); }
.srv-place {
  position: absolute; translate: -50% 0; padding: 0; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  animation: srv-float 6s ease-in-out infinite;
}
.srv-place:nth-child(2) { animation-delay: -1.5s; }
.srv-place:nth-child(3) { animation-delay: -3s; }
.srv-place:nth-child(4) { animation-delay: -4.5s; }
.srv-place:nth-child(5) { animation: none; } /* the survival spawn stands on the ground */
@keyframes srv-float { 50% { transform: translateY(-8px); } }
.srv-place img { display: block; width: 100%; height: auto; image-rendering: pixelated; transition: scale 0.2s, filter 0.2s; }
.srv-place:hover img, .srv-place:focus-visible img { scale: 1.06; filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8)); }
.srv-place:focus-visible { outline: none; }
.srv-label {
  padding: 2px 10px; border-radius: 999px; white-space: nowrap;
  font: 600 13.5px var(--font-body); color: #fff; background: rgba(0, 0, 0, 0.5);
}
.srv-place:focus-visible .srv-label { outline: 2px solid var(--gold); }
/* Phones: the places as a grid of pictures instead of a map */
@media (max-width: 700px) {
  .srvmap { aspect-ratio: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 14px; }
  .srv-place { position: static; translate: none; width: auto !important; animation: none; }
  .srv-label { white-space: normal; text-align: center; font-size: 12.5px; }
}

.srv-dialog {
  width: min(960px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 24px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 20px; color: var(--text); background: var(--bg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.srv-dialog[open] { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.srv-dialog::backdrop { background: rgba(5, 8, 20, 0.6); backdrop-filter: blur(3px); }
.srv-big { width: 100%; height: auto; image-rendering: pixelated; }
.srv-info h2 { margin: 0; font-size: 25.5px; }
.srv-info .en { margin: 2px 0 10px; font-family: var(--font-mono); color: var(--accent-soft); }
.srv-info .meta { margin: 6px 0 12px; }
.srv-facts { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.srv-facts th, .srv-facts td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.srv-facts th { width: 7.5em; color: var(--muted); font-weight: 600; }
.srv-close {
  position: absolute; right: 14px; top: 12px; width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 17.5px; cursor: pointer;
}
@media (max-width: 700px) { .srv-dialog[open] { grid-template-columns: 1fr; padding: 18px; } }

/* ---------- 贊助 page (donate.html) ---------- */
.donate-terms { margin: 0; padding-left: 0; list-style: none; counter-reset: term; line-height: 1.8; }
.donate-terms li { counter-increment: term; padding-left: 2.6em; text-indent: -2.6em; }
.donate-terms li::before { content: counter(term, cjk-ideographic) "、"; display: inline-block; width: 2.6em; text-indent: 0; color: var(--gold-text); }
.donate-links { display: flex; flex-wrap: wrap; gap: 10px; }
.donate-rate { font-size: 17.5px; font-weight: 700; color: var(--gold-text); }

/* 分流 page: mob and item pictures in the limit tables (js/servers.js data-ico) */
.mob-icos { display: inline-flex; flex-wrap: wrap; gap: 2px; margin-right: 8px; vertical-align: middle; }
.mob-ico { width: 24px; height: 24px; image-rendering: pixelated; }
.servers-page .note { font-size: 12.5px; color: var(--muted); }
.servers-page .wiki-table td:first-child { white-space: normal; } /* long lists of mobs wrap */

/* 生存世界: the three worlds' heights to scale (Y -64 at the bottom, 511 at the top) */
.ydia { position: relative; height: 340px; margin: 34px 0 18px; max-width: 560px; }
.ydia-col {
  position: absolute; width: 26%; border-radius: 4px; overflow: visible;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35); image-rendering: pixelated;
}
.ydia-col:nth-child(1) { left: 0; }
.ydia-col:nth-child(2) { left: 37%; }
.ydia-col:nth-child(3) { left: 74%; }
.ydia-col i { position: absolute; left: 0; right: 0; bottom: 0; background: center bottom / 16px repeat; }
.ydia-col b { position: absolute; left: 0; right: 0; top: -26px; text-align: center; font-size: 14.5px; color: var(--heading); }
.ydia-col span {
  position: absolute; left: 4px; font: 11.5px var(--font-mono); color: #fff; line-height: 1.3;
  text-shadow: 1px 1px 0 #000, -1px 1px 0 #000, 1px -1px 0 #000, -1px -1px 0 #000;
}
.ydia-col .top { top: 4px; }
.ydia-col .bot { bottom: 4px; }
.ydia-col .mid { transform: translateY(-110%); }
.ow { background: #8ec5ff; }
.ow .sky { top: 0; background: linear-gradient(#5f9fff, #b5d8ff); }
.ow .stone { background-image: url("../packs/vanilla/assets/minecraft/textures/block/stone.png"); }
.ow .deep { background-image: url("../packs/vanilla/assets/minecraft/textures/block/deepslate.png"); }
.ow .grass { height: 8px; background-image: url("../packs/vanilla/assets/minecraft/textures/block/grass_block_side.png"); background-size: 16px 8px; background-position: top; }
.ne { background: #3a0c0c; }
.ne .build { top: 0; background: linear-gradient(#5b1414, #2a0606); }
.ne .rack { background-image: url("../packs/vanilla/assets/minecraft/textures/block/netherrack.png"); }
.ne .roof, .ne .floor { height: 6px; background-image: url("../packs/vanilla/assets/minecraft/textures/block/bedrock.png"); background-size: 6px; }
.en { background: linear-gradient(#20112f, #0c0714); }
.en .isle { background-image: url("../packs/vanilla/assets/minecraft/textures/block/end_stone.png"); }
