.menu-actions{display:flex;justify-content:center;flex-wrap:wrap;gap:10px;margin:14px 0}.menu-actions .minor{font-weight:800;min-height:42px}
.overlay .menu-wallet{display:flex;align-items:baseline;justify-content:center;flex-wrap:wrap;gap:6px 10px;margin:20px auto 8px;font-size:.875rem;line-height:1.4;color:var(--muted)}
.menu-wallet strong{font-size:clamp(1.4rem,5vw,1.75rem);font-weight:900;color:#ffad43;font-variant-numeric:tabular-nums;white-space:nowrap}
.game-feature{color:#f9f6f0;background:#0b1427;border:1px solid #526078;border-radius:18px;padding:0;width:min(94vw,570px);max-width:570px;max-height:92svh;max-height:92dvh;overflow:auto;overscroll-behavior:contain;box-shadow:0 20px 100px #000b;touch-action:pan-y;user-select:none}
.game-feature::backdrop{background:#020309d9;backdrop-filter:blur(5px)}
.feature-header{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 16px;background:#111d33;position:sticky;top:0;z-index:3;border-bottom:1px solid #34415c}.feature-header h2{font-size:1.25rem;margin:0;letter-spacing:.06em}.feature-header button{font-size:.875rem}
.shop-view{padding:20px 14px 16px;background:radial-gradient(ellipse at 15% 12%,#f9c76c33,transparent 38%),radial-gradient(ellipse at 85% 12%,#f9c76c33,transparent 38%),repeating-linear-gradient(90deg,#3a251c 0 54px,#261912 54px 57px,#493024 57px 112px)}
.wood-sign{position:relative;display:grid;place-items:center;min-height:100px;line-height:1.2;width:max-content;max-width:94%;margin:8px auto 22px;padding:12px 24px;text-align:center;background:linear-gradient(#a56b37,#714021);border:4px solid #c38a4d;border-radius:8px;box-shadow:0 5px 0 #20150f,0 0 25px #e8b36e26;color:#ffdf9c;font-size:clamp(1.35rem,6vw,2rem);font-weight:900;letter-spacing:.06em;text-shadow:0 2px #382014}.wood-sign:before,.wood-sign:after{content:'';position:absolute;width:5px;height:22px;background:#beb4a0;top:-22px;left:20px;box-shadow:1px 0 2px #000}.wood-sign:after{left:auto;right:20px}
.shop-welcome{display:flex;align-items:center;justify-content:center;gap:14px;min-height:150px}.shop-welcome img{width:clamp(140px,40vw,230px);height:auto;flex-shrink:0;filter:drop-shadow(0 8px 4px #0007)}.shop-welcome p{position:relative;max-width:260px;padding:12px;background:#fff0d3;color:#4c311f;border:2px solid #c99658;border-radius:12px;font-size:.875rem;font-weight:700;line-height:1.7}
.shop-counter{position:relative;padding:34px 12px 20px;border:4px solid #bc874a;border-top:10px solid #d8a35e;border-radius:7px;background:repeating-linear-gradient(0deg,#754621 0 36px,#4a2a15 36px 39px);box-shadow:0 10px 0 #21160e,0 -3px 0 #48301b;margin:14px 0 24px}
.shop-wallet{padding:12px;background:#17120de8;border:1px solid #987344;border-radius:9px;color:#e7d6b4;text-align:center;font-size:.875rem}.shop-wallet p{margin:4px}.shop-wallet strong{font-size:1.35rem;color:#ffda7c}.shop-wallet p:last-child{margin-top:10px;color:#c4b397}
.ranking-dialog .feature-header{background:linear-gradient(105deg,#241936,#131f35);border-bottom-color:#825740}
.ranking-dialog .feature-header h2{font-size:clamp(1.45rem,6vw,2rem);font-weight:950;letter-spacing:.04em;color:#ffb052;text-shadow:0 2px #813910}
.ranking-view{padding:12px clamp(8px,3vw,16px) 20px;background:radial-gradient(ellipse at 50% 0,#2d214d,#0b1427 68%)}
.ranking-intro{text-align:center;color:#d3deee;font-size:.875rem;line-height:1.55}
.ranking-entry{display:flex;flex-wrap:wrap;gap:8px;margin-top:7px}
.ranking-entry input{min-width:120px;flex:1;width:100%;font:inherit;font-size:1rem;border:1px solid #637391;border-radius:8px;background:#060d1c;color:#fff;padding:10px;user-select:text;touch-action:manipulation}
.ranking-entry .primary{font-size:.875rem;padding:8px 16px}
.ranking-note{font-size:.875rem;line-height:1.6;color:#aebbd0}
.ranking-table table{width:100%;table-layout:fixed;border-collapse:separate;border-spacing:0 6px;font-size:.875rem;font-variant-numeric:tabular-nums}
.ranking-table .rank-column{width:clamp(40px,12vw,56px)}
.ranking-table .score-column{width:clamp(98px,28vw,132px)}
.ranking-table .bear-column{width:clamp(58px,14vw,70px)}
.ranking-table th,.ranking-table td{padding:8px 6px;text-align:left}
.ranking-table th{padding-block:4px;color:#bacbef;white-space:nowrap}
.ranking-table :is(th,td):first-child{text-align:center}
.ranking-table :is(th,td):nth-child(n+3){text-align:right;white-space:nowrap}
.ranking-table td{background:#192746}
.ranking-table td:first-child{border-radius:9px 0 0 9px}
.ranking-table td:last-child{border-radius:0 9px 9px 0}
.ranking-table td:nth-child(2){overflow-wrap:anywhere;font-weight:700}
.ranking-table td:nth-child(3){font-weight:900;white-space:normal}
.ranking-table tr.podium-1 td{background:#48331f;color:#ffe4a2;border-block:1px solid #936f3e}
.rank-badge{display:inline-grid;place-items:center;min-width:26px;height:26px;border-radius:50%;background:#263858;color:#eef2ff;font-weight:850}
:is(.podium-1,.podium-2,.podium-3) .rank-badge{background:none;font-size:1.28rem}
.ranking-table tr.is-me td{box-shadow:inset 0 -2px #6fcde9}
#ranking-status{font-size:.875rem;color:#ffda94}
#ranking-status:empty{display:none}
.nickname-view{padding:16px}
#nickname-status{color:#ffda94;font-size:.875rem}
#nickname-status:empty{display:none}
#menu .ranking-disclosure{margin:6px 0 0;color:var(--muted);font-size:.8125rem;line-height:1.4}
#menu .nickname-change{display:block;margin:4px auto 0;min-height:40px;font-size:.875rem}
.life-player{display:flex;flex-wrap:wrap;align-items:center;gap:3px 8px}
.life-player .life-heading{white-space:nowrap}
.game-player-name{max-width:100%;overflow-wrap:anywhere;color:#f9f6f0;font-size:.875rem;font-weight:750}
.player-name-with-status{display:inline-flex;align-items:center;gap:.3em;max-width:100%;vertical-align:middle}
.player-name-label{min-width:0;overflow-wrap:anywhere}
.player-master-badge{
  position:relative;
  flex:0 0 1.15em;
  height:1.15em;
  background:linear-gradient(140deg,#fff2a1 0%,#ffce51 48%,#df941e 100%);
  clip-path:polygon(50% 0%,62% 13%,80% 9%,86% 27%,100% 37%,94% 53%,98% 69%,80% 77%,73% 95%,55% 90%,40% 100%,28% 86%,10% 83%,9% 64%,0% 50%,10% 36%,12% 18%,31% 16%);
}
.player-master-badge::after{
  content:"";
  position:absolute;
  inset:27% 25% 30%;
  background:#392100;
  clip-path:polygon(0 57%,17% 40%,38% 63%,84% 12%,100% 27%,39% 96%);
}
.life-player .nickname-register{min-height:36px;font-size:.8125rem;padding:3px 6px}
.shell:not(.menu-screen) .nickname-register{display:none}
@media(max-height:500px){.shop-welcome{min-height:100px}.shop-welcome img{width:150px}.shop-view{padding-top:14px}.wood-sign{min-height:70px;font-size:1.3rem;margin-bottom:8px}}

body:has(#menu:not([hidden])),body:has(#stop:not([hidden])),body:has(#game-feature[open]){touch-action:pan-y}.overlay{touch-action:pan-y}

.life-stat{flex-direction:column;align-items:flex-start;gap:2px}.life-heading{display:flex;align-items:center;gap:5px}.life-heading #life-level{font-size:.875rem;color:#ffda94}.life-stat .lives{gap:2px}
.life-protection{display:flex;align-items:center;gap:5px}
.knight-armor-icon{
  flex:0 0 23px;
  height:20px;
  position:relative;
  background:#b5ffa5;
  clip-path:polygon(30% 0,40% 14%,60% 14%,70% 0,91% 9%,100% 35%,82% 49%,78% 88%,50% 100%,22% 88%,18% 49%,0 35%,9% 9%);
}
.knight-armor-icon::before{
  content:"";
  position:absolute;
  inset:2px 3px 3px;
  clip-path:inherit;
  background:linear-gradient(135deg,#f4fff7 18%,#9bc9b8 44%,#375958 52%,#d9fff0 88%);
}

.shop-goods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.upgrade-card {
  position: relative;
  display: grid;
  grid-template-rows: 88px auto 1fr auto auto auto;
  row-gap: 8px;
  overflow: hidden;
  padding: 12px 7px;
  text-align: center;
  border: 1px solid #ddbd7a77;
  border-radius: 8px;
  background: linear-gradient(#e3b87430, #1d130d50);
  box-shadow: 0 4px 0 #2e1a0f;
}
@supports (grid-template-rows: subgrid) {
  .upgrade-card {
    grid-row: span 6;
    grid-template-rows: subgrid;
  }
  .shop-goods {
    grid-auto-rows: minmax(0, auto);
  }
}
.upgrade-card h3 {
  margin: 0;
  font-size: clamp(.875rem, 3.5vw, 1rem);
  line-height: 1.25;
  color: #ffe8ae;
}
.upgrade-card p {
  margin: 0;
  color: #ddcba9;
  font-size: .875rem;
}
.product-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 88px;
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  font-weight: 900;
  color: #ffe8ae;
}
.btc-product-icon img {
  display: block;
  width: 38px;
  height: 38px;
}
.upgrade-card .upgrade-price {
  align-self: end;
  margin-block: 3px;
  color: #ffe49c;
  font-size: clamp(.875rem, 3.6vw, 1.15rem);
  font-weight: 850;
}
.upgrade-card .product-shortfall {
  grid-row: 6;
  min-height: 2.5em;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.product-buy {
  min-height: 44px;
  width: 100%;
  padding: 8px 12px;
  font-size: .875rem;
}
.product-buy:disabled {
  background: #695339;
  border-color: #8c795b;
  color: #c3b69f;
  box-shadow: 0 3px #302116;
  cursor: default;
}
.sold-out-label {
  position: absolute;
  inset: 42% auto auto -8%;
  width: 116%;
  transform: rotate(-16deg);
  padding: 8px 2px;
  background: #ffe6b9;
  color: #942b22;
  border-block: 3px solid #a3362b;
  box-shadow: 0 4px 8px #0008;
  font-size: clamp(1rem, 4.4vw, 1.55rem);
  font-weight: 950;
  letter-spacing: .02em;
}
.sold-out .product-icon { opacity: .5; }
.knight-product {
  border-color: #9dc884;
  background: linear-gradient(145deg, #264836, #1d2c25 65%, #17211e);
}
.knight-product-info { display: contents; }
.knight-product-image {
  display: block;
  width: min(100%, 88px);
  height: auto;
  margin: auto;
  border: 1px solid #a5eb9366;
  border-radius: 8px;
  background: #08110e;
}
.knight-product h3 { color: #efffe8; }
.knight-product .product-detail { color: #def0d7; }
.knight-product .upgrade-price { color: #dcffb9; }
.knight-product.sold-out .knight-product-image { opacity: .55; }
.knight-product .sold-out-label { pointer-events: none; }
.knight-details-toggle {
  position: relative;
  z-index: 1;
  margin-top: 6px;
  padding-inline: 6px;
  border-color: #78a77a;
  background: #182e28;
  color: #e5fbdc;
}
.knight-details {
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid #9dc884;
  border-radius: 9px;
  background: #152b24;
  color: #e9fbe3;
  font-size: .875rem;
  line-height: 1.55;
}
.knight-details h3 { margin: 0 0 8px; font-size: 1rem; }
.knight-details ul { margin: 0; padding-inline-start: 1.25em; }
.knight-details li + li { margin-top: 5px; }
.knight-details p { margin: 8px 0 0; }

@media (max-width: 500px) {
  .shop-goods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .knight-product {
    grid-column: 1 / -1;
    grid-row: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
  }
  .knight-product-image { width: min(100%, 176px); }
  .knight-product-info { display: grid; gap: 8px; }
  .knight-product .product-shortfall { grid-row: auto; }
}
@media (max-width: 420px) {
  .life-stat { max-width: 45%; }
  .life-stat .heart { width: 18px; font-size: 1.1rem; }
}

.shop-confirm{padding:14px;background:#fff0d3;color:#422916;border:3px solid #bd8c50;border-radius:10px;margin:0 0 14px;font-size:.875rem}.shop-confirm h3{margin:0 0 5px;font-size:1rem}.shop-confirm p{margin:4px 0 12px}.shop-confirm>div{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}.shop-status{padding:0 4px;color:#ffe5a2;font-size:.875rem;font-weight:750;line-height:1.6}.shop-status:empty{display:none}


.stop-navigation {
  display: flex;
  justify-content: center;
  gap: 8px;
}
#stop .stop-navigation button {
  min-width: 0;
  min-height: 46px;
  padding-inline: clamp(10px, 4vw, 22px);
  font-weight: 850;
}
#result-actions {
  display: grid;
  justify-items: center;
  gap: 9px;
  width: min(100%, 320px);
  margin: 14px auto 0;
}
#result-actions .minor { min-height: 44px; font-weight: 800; }
.result-ranking {
  position: relative;
  width: 100%;
  min-height: 54px;
  overflow: hidden;
  padding: 9px 12px;
  border: 2px solid #a68f62;
  border-radius: 12px;
  background: #15213a;
  color: #fff8e8;
  font-size: clamp(1.05rem, 5vw, 1.4rem);
  font-weight: 900;
  line-height: 1.25;
}
.result-ranking.new-best {
  min-height: 68px;
  border-color: transparent;
  background:
    linear-gradient(145deg, #211a39, #131e36) padding-box,
    linear-gradient(105deg, #ffd078, #ff9dc2, #b6a9ff, #8df1e2, #ffd078) border-box;
  box-shadow: 0 0 16px #c59afa4d;
}
.result-celebration {
  display: block;
  margin-bottom: 3px;
  color: #ffe1a4;
  font-size: clamp(.9rem, 4.5vw, 1.12rem);
  letter-spacing: .035em;
}
.result-celebration span { color: #f6cdff; }
@media (prefers-reduced-motion: no-preference) {
  #stop:not([hidden]) .result-ranking.new-best::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(110deg, transparent 37%, #fff3 50%, transparent 63%);
    animation: result-ranking-shine 1.15s ease-out both;
  }
}
@keyframes result-ranking-shine {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.ranking-player{display:flex;align-items:center;gap:8px;min-width:0}
.ranking-avatar{display:grid;place-items:center;width:36px;height:36px;flex:0 0 36px;overflow:hidden;border-radius:50%;border:1px solid #4a5058;background:#292e33}
.ranking-avatar img{display:block;width:100%;height:100%;object-fit:cover}
.ranking-avatar svg{display:block;width:25px;height:25px;fill:#7b838d}
.ranking-player-copy{display:block;min-width:0;overflow-wrap:anywhere}
.ranking-you{display:block;font-size:14px;font-weight:500;color:#b8e6f4}
@media(max-width:420px){.ranking-player{gap:5px}.ranking-avatar{width:30px;height:30px;flex-basis:30px}.ranking-avatar svg{width:22px;height:22px}}
@media(max-width:420px){.ranking-table .rank-column{width:34px}.ranking-table .score-column{width:92px}.ranking-table .bear-column{width:36px}.ranking-table th,.ranking-table td{padding-inline:4px}.ranking-you{white-space:nowrap}}

.guest-profile-picture{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-bottom:18px}
#nickname-image{padding:3px;border:0;background:transparent;border-radius:50%;touch-action:manipulation}
#nickname-image .ranking-avatar{width:64px;height:64px;flex-basis:64px}
#nickname-image .ranking-avatar svg{width:44px;height:44px}
#nickname-image-help,#nickname-image-status{flex-basis:100%;margin:0;font-size:14px;line-height:1.6}
#nickname-image-status{color:#b7ebd1}#nickname-image-status.is-error{color:#ffbd80}
#nickname-image-clear{font-size:14px}
.game-player-name .game-player-avatar{width:24px;height:24px;flex-basis:24px}.game-player-avatar svg{width:18px;height:18px}
