@font-face {
  font-family: 'VT323';
  src: url('/fonts/VT323-Regular.ttf?v=phase1-x2') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
:root {
  color-scheme: dark;
  font-family: 'VT323', 'Courier New', monospace;
  font-synthesis: none;
  color: #d5c5a0;
  background: #201b15;
  --stone: url('/textures/stone-wall.png?v=phase1-x2');
  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='3' seed='19' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23grain)' opacity='.21'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 280px; background: linear-gradient(#17130e55, #17130e55), var(--stone) center top / 512px 512px repeat, #201b15; }
a { color: #d6ba77; text-decoration: none; }
a:hover { color: #f2dcab; text-decoration: underline; }
a:focus-visible { outline: 2px solid #ead18c; outline-offset: 4px; }
[id] { scroll-margin-top: 18px; }
.skip-link { position: fixed; z-index: 8; top: 10px; left: 10px; padding: 10px 14px; border: 2px outset #9b8660; color: #efd28d; background: #3e3423; transform: translateY(-160%); font-size: 18px; }
.skip-link:focus { transform: translateY(0); }
.page-shell { width: min(100% - 40px, 1120px); margin: 0 auto; padding-bottom: 54px; }
.site-header { display: flex; align-items: center; justify-content: center; padding: 30px 0 23px; }
.brand { display: block; width: min(100%, 460px); }
.brand-title { margin: 0; line-height: 0; }
.brand-image { display: block; width: 100%; height: auto; }
main { display: grid; gap: 29px; min-width: 0; }
.game-section { min-width: 0; }
.player-frame {
  position: relative; width: 100%; padding: 13px; border: 3px solid;
  border-color: #988465 #17150f #0c0d09 #7e6e51; outline: 2px solid #0c0d08;
  background: linear-gradient(#51443288, #51443288), var(--stone) center / 384px 384px repeat, #3c3428;
  box-shadow: inset 2px 2px 0 #baa37680, inset -2px -2px 0 #100f0b, inset 5px 5px 0 #75614555, inset -5px -5px 0 #211b1299, 0 0 0 5px #342b1d, 0 7px 0 5px #0f100b, 0 13px 20px #0009;
}
.player-frame::before, .contract-stone::before {
  content: ''; position: absolute; inset: 5px; pointer-events: none;
  background: radial-gradient(circle, #baa275 0 1px, #6a5b3d 1px 3px, #19190f 3px 4px, transparent 4px) left top / 8px 8px no-repeat, radial-gradient(circle, #baa275 0 1px, #6a5b3d 1px 3px, #19190f 3px 4px, transparent 4px) right top / 8px 8px no-repeat, radial-gradient(circle, #baa275 0 1px, #6a5b3d 1px 3px, #19190f 3px 4px, transparent 4px) left bottom / 8px 8px no-repeat, radial-gradient(circle, #baa275 0 1px, #6a5b3d 1px 3px, #19190f 3px 4px, transparent 4px) right bottom / 8px 8px no-repeat;
}
.game-viewport { width: 100%; aspect-ratio: 765 / 503; overflow: hidden; border: 0; background: #10110a; box-shadow: 0 0 0 3px #14140d, 0 0 0 5px #6a5b3e, 0 0 0 6px #14130d; }
iframe { display: block; width: 100%; height: 100%; border: 0; }
.contract-stone {
  position: relative; display: flex; align-items: center; gap: 19px; min-width: 0; padding: 22px 25px;
  border: 3px solid; border-color: #89785b #15130e #0e0f0a #726347; outline: 2px solid #0d0e09;
  background: linear-gradient(#24201599, #24201599), var(--stone) center / 256px 256px repeat, #302719;
  box-shadow: inset 2px 2px 0 #b3a07944, inset -3px -3px 0 #090a07, 0 0 0 3px #423825, 0 5px 0 3px #0e100a, 0 9px 15px #0008;
}
.stone-seal { width: 34px; height: 34px; flex-shrink: 0; color: #ad925b; filter: drop-shadow(1px 2px 0 #080907); }
.contract-copy {
  min-width: 0; padding: 11px 14px; flex: 1; border: 2px solid; border-color: #100f09 #64563a #5c4f35 #0b0d08;
  background: linear-gradient(#18160ce6, #18160ce6), var(--stone) center / 160px 160px repeat, #211b12;
  box-shadow: inset 2px 3px 3px #0009;
}
.contract-copy h2 { margin: 0 0 7px; color: #c8b17a; font-size: 20px; font-weight: 400; line-height: 1.2; text-shadow: 1px 1px #000; }
.contract-address { margin: 0; color: #e6ce92; font-size: 21px; line-height: 1.25; overflow-wrap: anywhere; text-shadow: 1px 1px #070806; }
.tutorial-panel {
  position: relative; min-width: 0; margin: 13px 6px 0; padding: 35px 35px 37px;
  border: 1px solid #99713b; border-radius: 3px 5px 4px 2px; color: #3e2814;
  background: linear-gradient(90deg, #a1773266, #f4dfac22 9%, #f4dfac22 91%, #a1773266), var(--paper-grain) 0 0 / 160px 160px repeat, repeating-linear-gradient(0deg, transparent 0 5px, #764b1109 5px 6px), #d9bf88;
  box-shadow: inset 2px 0 #f5dcaa, inset -2px 0 #a98148, 0 4px 0 #261a0e, 0 10px 18px #000b;
}
.tutorial-panel::before, .tutorial-panel::after {
  content: ''; position: absolute; z-index: 1; left: -11px; right: -11px; height: 21px;
  border: 1px solid #5b3c1b; border-radius: 8px 5px 5px 8px;
  background: var(--paper-grain) center / 160px 160px repeat, linear-gradient(0deg, #705026 0, #aa7c3b 14%, #d0a865 32%, #f1d99b 58%, #d6b273 82%, #9b733b 100%), #c69d5c;
  box-shadow: inset 5px 0 0 #60421e, inset 7px 0 0 #dab774, inset -5px 0 0 #61411d, inset -7px 0 0 #dcc086, 1px 4px 5px #0008;
  pointer-events: none;
}
.tutorial-panel::before { top: -11px; }
.tutorial-panel::after { bottom: -10px; transform: rotate(180deg); box-shadow: inset 5px 0 #60421e, inset 7px 0 #dab774, inset -5px 0 #61411d, inset -7px 0 #dcc086, -1px -4px 5px #0008; }
.tutorial-panel > h2 { margin: 0 0 24px; padding-bottom: 12px; border-bottom: 2px solid #8c603452; color: #4a2b11; font-size: 38px; font-weight: 400; line-height: 1; text-align: center; text-shadow: 1px 1px #f2dda5; }
.tutorial-steps { display: grid; gap: 23px; padding: 0; margin: 0; list-style: none; }
.tutorial-steps li { display: flex; align-items: flex-start; gap: 15px; min-width: 0; }
.tutorial-steps li > div { min-width: 0; }
.step-number { display: grid; place-items: center; width: 31px; height: 33px; flex-shrink: 0; margin-top: 1px; border: 1px solid #856030; color: #684119; background: var(--paper-grain), #e2c996; box-shadow: inset 1px 1px #f8e7bd, inset -1px -1px #b08d58, 1px 2px #aa874c66; font-size: 22px; line-height: 1; }
.tutorial-steps h3 { margin: 1px 0 6px; color: #4a2b11; font-size: 25px; font-weight: 400; line-height: 1; }
.tutorial-steps p { margin: 0; color: #4d341d; font-size: 22px; line-height: 1.25; }
.tutorial-steps strong { color: #3f220e; font-weight: 400; text-decoration: underline; text-decoration-color: #80512e7a; text-underline-offset: 2px; }
.leaderboard-stone {
  position: relative; min-width: 0; padding: 27px 28px 22px; border: 3px solid;
  border-color: #9c8868 #1d1a13 #0e100b #78684c; outline: 2px solid #0b0d08;
  background: linear-gradient(#17160dd9, #211c12c4), var(--stone) center / 320px repeat, #29241a;
  box-shadow: inset 2px 2px #b8a47a55, inset -3px -3px #050704, 0 0 0 4px #3d3424, 0 7px 0 4px #0e100a, 0 12px 22px #0009;
}
.leaderboard-heading { display: flex; align-items: center; justify-content: center; gap: 20px; padding-bottom: 14px; border-bottom: 1px solid #826b3e66; }
.leaderboard-heading h1, .leaderboard-heading h2 { margin: 0; font-size: 40px; line-height: 1; font-weight: 400; color: #ead28e; text-shadow: 2px 2px #000, 0 0 10px #b88d3440; text-align: center; }
.ornament { font-size: 21px; color: #927a48; text-shadow: 1px 2px #000; }
.rank-description { margin: 12px 0 23px; text-align: center; font-size: 21px; color: #beae87; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 17px; max-width: 820px; margin: 0 auto; }
.podium-place { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.rank-1 { grid-column: 2; grid-row: 1; }
.rank-2 { grid-column: 1; grid-row: 1; }
.rank-3 { grid-column: 3; grid-row: 1; }
.rank-crown { color: #aa9470; font-size: 28px; line-height: 1; margin-bottom: 9px; text-shadow: 2px 2px #000; }
.rank-1 .rank-crown { color: #e7bc4f; font-size: 40px; }
.rank-3 .rank-crown { color: #a7784b; }
.rank-avatar { position: relative; display: grid; place-items: center; width: var(--avatar-size); height: var(--avatar-size); flex-shrink: 0; margin: 0 auto; border: 2px solid; border-color: #b79c65 #32291a #15190e #8c7a50; outline: 2px solid #0d1008; background: var(--stone), #383222; box-shadow: inset 0 0 0 2px #1a1b0f, 0 4px 7px #0009; }
.rank-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rank-avatar img[hidden] { display: none; }
.avatar-fallback { display: none; color: #ae965a; font-size: 27px; }
.avatar-fallback.visible { display: block; }
.podium-place h3 { margin: 13px 0 7px; max-width: 100%; overflow-wrap: anywhere; font-weight: 400; font-size: 26px; line-height: 1; color: #ddcfaa; text-shadow: 1px 2px #000; }
.rank-1 h3 { color: #f0d391; }
.podium-level { margin: 0; font-size: 23px; color: #baad8b; }
.podium-level strong { font-weight: 400; color: #f2d788; }
.podium-xp { margin: 3px 0 14px; color: #a69979; font-size: 19px; }
.podium-plinth {
  position: relative; display: grid; place-items: center; width: 100%; min-height: 116px;
  border: 4px solid; border-color: #98805a #332c1f #13160e #6f5e41;
  background: linear-gradient(90deg, #100f0980, transparent 14%, transparent 86%, #05070599), linear-gradient(#7b654a33, #30291988), var(--stone) center / 180px repeat, #342f24;
  box-shadow: inset 2px 2px #b7a27377, inset -3px -3px #05070499, 0 6px 0 #100e09, 0 9px 12px #0008;
}
.podium-plinth::before { content: ''; position: absolute; left: -5px; right: -5px; top: -9px; height: 12px; border: 2px outset #918064; background: linear-gradient(#a59570, #736448 48%, #4c422e 49%); box-shadow: 0 3px 3px #0008; }
.podium-plinth span { display: grid; place-items: center; width: 60px; height: 65px; border: 2px inset #685433; color: #b2a082; background: #18160e99; font-size: 47px; line-height: 1; text-shadow: 2px 2px #000; box-shadow: inset 0 2px 5px #0009; }
.rank-1 .podium-plinth { min-height: 164px; }
.rank-1 .podium-plinth span { color: #ebca78; border-color: #97773c; }
.rank-3 .podium-plinth { min-height: 87px; }
.rank-3 .podium-plinth span { color: #bd9268; }
.leaderboard-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 29px; padding-top: 18px; border-top: 1px solid #80693b66; }
.rank-status { margin: 0; color: #a89975; font-size: 19px; line-height: 1.1; }
.stone-button { display: inline-flex; justify-content: center; align-items: center; gap: 11px; padding: 10px 20px; border: 3px solid; border-color: #9b8662 #24251a #11140b #736347; color: #e5cf94; background: linear-gradient(#65553c55, #28221788), var(--stone) center / 160px, #3a3123; box-shadow: inset 1px 1px #c2a87444, inset -1px -1px #050704, 0 3px #11130b; font-size: 23px; line-height: 1; text-shadow: 1px 2px #000; }
.stone-button:hover { color: #ffe2a1; text-decoration: none; border-top-color: #cfb17a; }
.stone-button.disabled { color: #796e53; opacity: .65; }
.x-community-link {
  position: fixed; z-index: 7; left: max(16px, env(safe-area-inset-left)); bottom: calc(16px + env(safe-area-inset-bottom));
  min-height: 48px; gap: 10px; padding: 10px 14px; font-size: 22px;
}
.x-community-link svg { width: 18px; height: 18px; flex-shrink: 0; filter: drop-shadow(1px 2px #000); }
.world-page .page-shell { padding-bottom: calc(98px + env(safe-area-inset-bottom)); }
.rank-empty { text-align: center; min-height: 96px; display: grid; place-items: center; font-size: 23px; color: #c6b892; }
.leaderboard-back { margin-bottom: 3px; }
.full-leaderboard > .rank-status { text-align: center; margin-top: 24px; }
.ranking-scroll { width: 100%; overflow-x: auto; margin-top: 35px; border: 2px inset #736244; background: #18160ebf; }
.ranking-table { width: 100%; border-collapse: collapse; font-size: 22px; text-align: center; }
.ranking-table thead { color: #d9c08c; background: linear-gradient(#48403188, #332c20bb), var(--stone) center / 160px; }
.ranking-table th, .ranking-table td { padding: 16px 10px; font-weight: 400; }
.ranking-table thead th { border-bottom: 2px solid #756143; }
.ranking-table tbody tr:nth-of-type(4n + 1) { background: #7b674410; }
.ranking-table tbody > tr:not(.skills-row) > th, .ranking-table tbody > tr:not(.skills-row) > td { padding-bottom: 8px; }
.rank-position { color: #c6ac74; font-size: 27px; }
.rank-name { display: block; margin-top: 8px; max-width: 180px; margin-inline: auto; overflow-wrap: anywhere; color: #decea2; }
.rank-total { color: #efcf7e; font-size: 28px; }
.skills-row td { padding-top: 0; padding-bottom: 16px; border-bottom: 1px solid #78634055; }
.skills-row summary { cursor: pointer; width: fit-content; margin: 0 auto; color: #a99b78; font-size: 18px; }
.rank-skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 16px 6px 0; text-align: left; font-size: 21px; }
.rank-skills span { display: flex; justify-content: space-between; border-bottom: 1px solid #78634055; padding: 4px 3px; }
.rank-skills strong { font-weight: 400; color: #e3cb91; }
.ranking-pages { display: flex; justify-content: center; align-items: center; gap: 19px; margin-top: 25px; font-size: 22px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 600px) {
  .page-shell { width: calc(100% - 32px); padding-bottom: 38px; }
  .site-header { padding: 24px 0 21px; }
  main { gap: 25px; }
  .player-frame { padding: 9px; }
  .contract-stone { gap: 11px; padding: 18px 15px; }
  .stone-seal { width: 25px; height: 25px; }
  .contract-copy { padding: 10px 11px; }
  .contract-copy h2 { font-size: 18px; }
  .contract-address { font-size: 19px; }
  .tutorial-panel { margin-inline: 5px; padding: 29px 20px 32px; }
  .tutorial-panel > h2 { font-size: 32px; margin-bottom: 22px; }
  .tutorial-steps { gap: 22px; }
  .tutorial-steps li { gap: 11px; }
  .tutorial-steps h3 { font-size: 23px; }
  .tutorial-steps p { font-size: 20px; }
  .leaderboard-stone { padding: 24px 12px 20px; }
  .leaderboard-heading { gap: 9px; }
  .leaderboard-heading h1, .leaderboard-heading h2 { font-size: 31px; }
  .ornament { font-size: 15px; }
  .rank-description { font-size: 19px; line-height: 1.05; }
  .podium { gap: 8px; }
  .podium-place h3 { font-size: 21px; min-height: 42px; }
  .podium-level { font-size: 18px; }
  .podium-xp { font-size: 16px; }
  .podium-plinth { min-height: 100px; border-width: 3px; }
  .rank-1 .podium-plinth { min-height: 136px; }
  .rank-3 .podium-plinth { min-height: 74px; }
  .podium-plinth span { width: 45px; height: 48px; font-size: 35px; }
  .leaderboard-footer { margin-top: 24px; }
  .leaderboard-footer .rank-status { max-width: 54%; }
  .stone-button { padding: 9px 13px; font-size: 21px; }
  .x-community-link { left: max(12px, env(safe-area-inset-left)); bottom: calc(12px + env(safe-area-inset-bottom)); min-height: 44px; padding: 8px 11px; gap: 8px; font-size: 20px; }
  .x-community-link svg { width: 17px; height: 17px; }
  .world-page .page-shell { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .ranking-table { min-width: 390px; font-size: 19px; }
  .ranking-table th, .ranking-table td { padding-inline: 7px; }
  .rank-total { font-size: 23px; }
  .ranking-pages { gap: 10px; font-size: 19px; }
  .ranking-pages .stone-button { padding-inline: 9px; }
}
@media (max-width: 350px) {
  .page-shell { width: calc(100% - 28px); }
  .player-frame { padding: 8px; }
  .contract-stone { padding-inline: 13px; gap: 9px; }
  .stone-seal { display: none; }
  .tutorial-panel { padding-inline: 16px; }
  .tutorial-steps li { gap: 9px; }
  .step-number { width: 25px; height: 28px; font-size: 20px; }
  .tutorial-steps p { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
