﻿
    :root {
      --app-vh: 100dvh;
      --bg: #050506;
      --panel: #0d0f14;
      --panel-2: #151922;
      --line: #2b3342;
      --text: #f4f6fb;
      --muted: #9aa3b4;
      --accent: #ff5a11;
      --accent-2: #ff9a2f;
      --blue: #1c52ff;
      --purple: #6828ff;
    }

    * { box-sizing: border-box; }

    /* Keep scrolling, but hide native scrollbar chrome (arrow/button glyphs). */
    * {
      scrollbar-width: none;
      -ms-overflow-style: none;
    }
    *::-webkit-scrollbar {
      width: 0;
      height: 0;
      background: transparent;
    }
    *::-webkit-scrollbar-button {
      width: 0;
      height: 0;
      display: none;
    }

    html, body {
      margin: 0;
      min-height: 100%;
      overscroll-behavior: none;
      background:
        radial-gradient(1200px 500px at 80% -10%, rgba(255, 90, 17, 0.20), transparent 60%),
        radial-gradient(700px 420px at 10% 20%, rgba(255, 120, 20, 0.14), transparent 60%),
        var(--bg);
      color: var(--text);
      font-family: "Manrope", "Segoe UI", sans-serif;
    }

    body {
      display: flex;
      justify-content: center;
      padding: 10px;
      overflow: hidden;
    }

    .screen {
      width: 100%;
      max-width: 430px;
      min-height: calc(var(--app-vh, 100dvh) - 20px);
      border-radius: 24px;
      padding: calc(12px + env(safe-area-inset-top, 0px)) 10px calc(10px + env(safe-area-inset-bottom, 0px));
      background: linear-gradient(180deg, #090b11 0%, #050506 28%, #040507 100%);
      box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
      position: relative;
      overflow: hidden;
      overscroll-behavior: none;
    }

    .top {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 10px;
    }
    .top .top-amber {
      margin-left: auto;
      min-width: fit-content;
      width: auto;
      padding: 0 10px;
      flex: 0 0 auto;
      white-space: nowrap;
    }
    .top .settings {
      margin-left: 8px;
      flex: 0 0 auto;
    }
    .tribe {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .tribe-icon, .settings {
      width: 34px;
      height: 34px;
      border-radius: 12px;
      border: 1px solid #3a2d22;
      display: grid;
      place-items: center;
      background: #111318;
      color: #ff8b2f;
      font-size: 18px;
    }
    .tribe-icon {
      overflow: hidden;
    }
    .tribe-icon-img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .settings {
      padding: 0;
      font-size: 20px;
      line-height: 1;
      font-family: "Segoe UI", "Manrope", sans-serif;
      font-weight: 700;
      transform: none;
      text-align: center;
    }

    .tribe-name { font-size: 17px; font-weight: 800; line-height: 1.05; }
    .tribe-name.is-clickable { cursor: pointer; }
    .tribe-level { font-size: 12px; color: #fcb24d; font-weight: 700; margin-top: 2px; }

    .resources {
      margin-top: 12px;
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 6px;
    }

    .res {
      min-height: 34px;
      border-radius: 11px;
      border: 1px solid #31394b;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      font-size: 12px;
      font-weight: 800;
      background: #111521;
      min-width: 0;
    }

    .res span:last-child {
      font-size: clamp(13px, 3.6vw, 17px);
      line-height: 1;
      white-space: nowrap;
      letter-spacing: 0;
      font-variant-numeric: tabular-nums;
      font-feature-settings: "tnum" 1;
    }

    .amber-icon-slot,
    .amber-inline-icon,
    .amber-gem-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      line-height: 0;
    }

    .amber-icon-slot svg,
    .amber-inline-icon svg,
    .amber-gem-icon svg {
      display: block;
    }

    .building-title,
    .warrior-name,
    .raid-mode-title,
    .evolution-item-name,
    .shop-item-name,
    .amber-item-name {
      min-width: 0;
      overflow-wrap: break-word;
      word-break: normal;
    }

    .res.accent {
      color: #fff4ea;
      border-color: #9f430d;
      background: linear-gradient(180deg, #ff6a1c 0%, #e84d00 100%);
    }
    .event-view {
      min-height: 100%;
      display: flex;
      flex-direction: column;
      gap: 10px;
      overflow-y: auto;
      padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px));
    }
    .event-hub-view {
      min-height: 100%;
      display: flex;
      flex-direction: column;
      gap: 10px;
      overflow-y: auto;
      padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    }
    .event-hub-card {
      width: 100%;
      border-radius: 16px;
      border: 1px solid #2f384b;
      background: linear-gradient(180deg, #111824 0%, #0c121c 100%);
      color: #eef3ff;
      text-align: left;
      padding: 12px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      font-family: inherit;
      cursor: pointer;
    }
    .event-hub-card:disabled {
      opacity: 0.65;
      cursor: default;
    }
    .event-hub-card-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      font-size: 14px;
      font-weight: 900;
      color: #f7f9ff;
    }
    .event-hub-card-status {
      border-radius: 999px;
      border: 1px solid #3e4f69;
      background: rgba(20, 29, 43, 0.92);
      color: #c8d4eb;
      font-size: 10px;
      font-weight: 800;
      line-height: 1;
      padding: 4px 8px;
      text-transform: uppercase;
      white-space: nowrap;
    }
    .event-hub-card-status.is-live {
      border-color: #a84318;
      background: rgba(48, 21, 9, 0.92);
      color: #ffd8bf;
    }
    .event-hub-card-status.is-off {
      border-color: #5a667c;
      color: #b4bfd4;
    }
    .event-hub-card-meta {
      font-size: 12px;
      line-height: 1.35;
      color: #c2cee1;
      font-weight: 700;
    }
    .event-top {
      border: 1px solid #3c2d22;
      border-radius: 16px;
      background: linear-gradient(180deg, #18100c 0%, #0f1116 100%);
      padding: 10px;
    }
    .event-title {
      margin: 8px 0 0;
      font-size: 21px;
      font-weight: 900;
      line-height: 1.08;
      color: #ffe7cd;
    }
    .event-sub {
      margin: 6px 0 0;
      font-size: 12px;
      line-height: 1.35;
      color: #ffcfa8;
      font-weight: 700;
    }
    .event-map-card {
      border: 1px solid #2f384b;
      border-radius: 16px;
      background: linear-gradient(180deg, #111824 0%, #0c121c 100%);
      padding: 10px;
    }
    .event-map-title {
      font-size: 14px;
      font-weight: 800;
      color: #eaf0ff;
      margin-bottom: 8px;
    }
    .event-map {
      position: relative;
      min-height: 208px;
      border-radius: 14px;
      border: 1px solid #33445f;
      background:
        radial-gradient(560px 180px at 50% 0%, rgba(255, 112, 24, 0.18), transparent 65%),
        radial-gradient(700px 230px at 20% 100%, rgba(38, 114, 255, 0.14), transparent 70%),
        #0a1019;
      overflow: hidden;
    }
    .event-map::after {
      content: "";
      position: absolute;
      inset: 0;
      pointer-events: none;
      background-image:
        linear-gradient(to right, rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px);
      background-size: 22px 22px;
      opacity: 0.35;
    }
    .event-point {
      position: absolute;
      transform: translate(-50%, -50%);
      min-width: 96px;
      border-radius: 999px;
      border: 1px solid #4a5c77;
      background: rgba(9, 16, 27, 0.86);
      color: #f3f7ff;
      font-size: 11px;
      font-weight: 800;
      line-height: 1.15;
      text-align: center;
      padding: 7px 10px;
      z-index: 1;
    }
    .event-point.active {
      border-color: #ff8b3d;
      box-shadow: 0 0 0 2px rgba(255, 110, 30, 0.2);
      background: rgba(36, 19, 8, 0.92);
    }
    .event-point-status {
      margin-top: 3px;
      font-size: 10px;
      color: #b8c5de;
    }
    .event-point.active .event-point-status {
      color: #ffd8bc;
    }
    .event-point.p-contested {
      border-color: #f9a843;
    }
    .event-point.p-owned {
      border-color: #3fc17c;
    }
    .event-point.p-neutral {
      border-color: #5a6578;
    }
    .event-map-open-btn {
      width: 100%;
    }
    .event-map-view {
      min-height: 100%;
      display: flex;
      flex-direction: column;
      gap: 10px;
      overflow: hidden;
      padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    }
    .event-map-screen-card {
      border: 1px solid #2f384b;
      border-radius: 16px;
      background: linear-gradient(180deg, #111824 0%, #0c121c 100%);
      padding: 10px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      min-height: 0;
      flex: 1 1 auto;
    }
    .event-map-screen-hint {
      font-size: 12px;
      color: #c0ccdf;
      font-weight: 700;
      line-height: 1.35;
    }
    .event-map-canvas-wrap {
      position: relative;
      border-radius: 12px;
      border: 1px solid #33445f;
      overflow: hidden;
      background: #0a1019;
      min-height: 360px;
      flex: 1 1 auto;
    }
    .event-map-canvas {
      width: 100%;
      height: 100%;
      display: block;
      touch-action: none;
      user-select: none;
      -webkit-user-select: none;
      -webkit-touch-callout: none;
    }
    .event-map-screen-actions {
      display: grid;
      grid-template-columns: 1fr;
      gap: 8px;
    }
    .event-info-card {
      border: 1px solid #2d3442;
      border-radius: 14px;
      background: #0f131b;
      padding: 10px;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .event-info-title {
      font-size: 14px;
      font-weight: 800;
      color: #f5f8ff;
    }
    .event-info-meta {
      font-size: 12px;
      color: #b4bfd3;
      font-weight: 700;
      line-height: 1.35;
      white-space: pre-line;
    }
    .event-info-actions {
      margin-top: 4px;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }
    .event-claim-row {
      margin-top: 8px;
    }
    .event-howto {
      border: 1px solid #2a3340;
      border-radius: 14px;
      background: #10161f;
      padding: 10px;
    }
    .event-howto-title {
      font-size: 13px;
      font-weight: 800;
      margin-bottom: 6px;
      color: #f1f6ff;
    }
    .event-howto-step {
      font-size: 12px;
      color: #bdc8da;
      line-height: 1.36;
      font-weight: 700;
      margin-top: 4px;
    }
    .event-topboard {
      border: 1px solid #2a3340;
      border-radius: 14px;
      background: #0f141c;
      padding: 10px;
    }
    .event-topboard-title {
      font-size: 13px;
      font-weight: 800;
      color: #eef3ff;
      margin-bottom: 6px;
    }
    .event-topboard-list {
      font-size: 12px;
      color: #c0ccdf;
      line-height: 1.35;
      white-space: pre-line;
      font-weight: 700;
    }

    .tabbar {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      margin-top: 0;
      padding: 0 0 calc(4px + env(safe-area-inset-bottom, 0px));
      z-index: 20;
    }

    .tabs {
      background: transparent;
      border: 0;
      border-radius: 0;
      padding: 0;
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 4px;
    }

    .tab {
      min-height: 56px;
      border-radius: 11px;
      border: 1px solid #2b3342;
      background: #0f1522;
      color: #8e97a8;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 3px;
      padding: 3px 2px;
      line-height: 1.05;
      text-align: center;
      font-family: inherit;
      font-size: clamp(10px, 2.65vw, 12px);
      font-weight: 700;
    }

    .tab.active {
      color: #fff3e6;
      border-color: #82370f;
      background: linear-gradient(180deg, #ff6b1d 0%, #e55003 100%);
    }

    .tab .i { font-size: 18px; line-height: 1; }

    .view-hidden { display: none !important; }

    .onboarding-view {
      position: absolute;
      inset: 0;
      z-index: 80;
      border-radius: 24px;
      background: #000;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
    }
    .onboarding-hero {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 58%;
      background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.10) 12%, rgba(0, 0, 0, 0.88) 100%),
        url("/miniapp/assets/cards/logo.png"),
        radial-gradient(360px 220px at 50% 10%, rgba(255, 120, 40, 0.22), transparent 72%);
      background-position: center top;
      background-size: cover;
      background-repeat: no-repeat;
      filter: saturate(0.8) brightness(0.56);
      pointer-events: none;
    }
    .onboarding-content {
      position: relative;
      z-index: 2;
      padding: 0 14px calc(14px + env(safe-area-inset-bottom, 0px));
      margin-top: auto;
    }
    .onboarding-title {
      margin: 0;
      font-size: clamp(30px, 10.2vw, 44px);
      line-height: 0.95;
      font-weight: 900;
      color: #fff;
      letter-spacing: -0.02em;
    }
    .onboarding-sub {
      margin: 8px 0 0;
      color: #ffb468;
      font-size: 17px;
      font-weight: 800;
      line-height: 1.2;
    }
    .onboarding-actions {
      margin-top: 14px;
      display: grid;
      gap: 8px;
    }
    .onboarding-btn {
      min-height: 44px;
      border-radius: 12px;
      border: 1px solid #3f4a63;
      background: #111726;
      color: #f3f7ff;
      font-family: inherit;
      font-size: 15px;
      font-weight: 800;
      padding: 0 12px;
    }
    .onboarding-btn.primary {
      border: 0;
      background: linear-gradient(180deg, #ff6b1d 0%, #e75306 100%);
      color: #fff7ef;
    }
    .onboarding-btn:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }
    .onboarding-name-wrap {
      margin-top: 14px;
      padding: 12px;
      border-radius: 14px;
      border: 1px solid #2f3748;
      background: linear-gradient(180deg, #10151f 0%, #0a0f18 100%);
    }
    .onboarding-name-input {
      width: 100%;
      min-height: 44px;
      border-radius: 12px;
      border: 1px solid #46516a;
      background: #0f1522;
      color: #fff;
      font-family: inherit;
      font-size: 15px;
      font-weight: 700;
      padding: 0 12px;
      outline: none;
    }
    .onboarding-name-actions {
      margin-top: 10px;
      display: flex;
      gap: 8px;
      justify-content: flex-end;
    }
    .onboarding-note {
      margin-top: 8px;
      color: #cfd7e7;
      font-size: 12px;
      line-height: 1.3;
      min-height: 16px;
    }
    #onboarding-flow-body.onboarding-note {
      margin-top: 0;
      min-height: 40px;
      font-size: 13px;
      color: #f2f5fb;
    }
    #onboarding-flow-view {
      justify-content: center;
      align-items: center;
      padding: 16px;
    }
    #onboarding-flow-view .onboarding-content {
      width: min(94%, 420px);
      margin: 0;
      padding: 0;
      text-align: center;
    }
    #onboarding-flow-view .onboarding-name-wrap {
      margin-top: 12px;
      text-align: left;
    }
    .tutorial-disabled {
      pointer-events: none !important;
      opacity: 0.36 !important;
      filter: saturate(0.5);
    }
    .tutorial-focus {
      position: relative;
      z-index: 3;
      box-shadow: 0 0 0 2px rgba(255, 162, 72, 0.95), 0 0 0 8px rgba(255, 127, 39, 0.22) !important;
      animation: tutorialPulse 1.05s ease-in-out infinite;
    }
    @keyframes tutorialPulse {
      0% { transform: scale(1); }
      50% { transform: scale(1.035); }
      100% { transform: scale(1); }
    }
    .onboarding-privacy-link {
      margin-top: 12px;
      width: 100%;
      border: 0;
      background: transparent;
      color: #9fb2cf;
      font-family: inherit;
      font-size: 12px;
      font-weight: 700;
      text-align: center;
      padding: 8px 2px 0;
      text-decoration: underline;
      text-underline-offset: 2px;
    }
    .onboarding-legal-modal {
      position: absolute;
      inset: 0;
      z-index: 90;
      background: rgba(0, 0, 0, 0.62);
      display: grid;
      place-items: center;
      padding: 16px;
    }
    .onboarding-legal-card {
      width: 100%;
      max-width: 360px;
      border-radius: 18px;
      border: 1px solid #2f3748;
      background: linear-gradient(180deg, #111521 0%, #0b1019 100%);
      box-shadow: 0 16px 42px rgba(0, 0, 0, 0.52);
      padding: 14px 12px 12px;
    }
    .onboarding-legal-title {
      font-size: 22px;
      line-height: 1.08;
      font-weight: 800;
      color: #fff3e5;
      margin: 0;
    }
    .onboarding-legal-body {
      margin-top: 8px;
      min-height: 180px;
      max-height: min(48dvh, 320px);
      overflow: auto;
      border-radius: 12px;
      border: 1px solid #2b3344;
      background: #0a0f17;
      padding: 10px;
      color: #d6deee;
      font-size: 13px;
      line-height: 1.45;
      white-space: pre-wrap;
    }
    .onboarding-legal-check {
      margin-top: 10px;
      display: flex;
      align-items: flex-start;
      gap: 8px;
      color: #e2eaf9;
      font-size: 13px;
      font-weight: 700;
      line-height: 1.3;
    }
    .onboarding-legal-actions {
      margin-top: 12px;
      display: flex;
      justify-content: flex-end;
      gap: 8px;
    }

    .placeholder {
      position: absolute;
      inset: 0;
      z-index: 20;
      min-height: 0;
      height: 100%;
      background: #000;
      border-radius: 24px;
      padding: 18px;
      display: flex;
      flex-direction: column;
      gap: 14px;
      overflow-y: auto;
    }

    .placeholder-title {
      margin: 0;
      font-size: 22px;
      font-weight: 800;
      color: #fff;
    }

    .back-btn {
      width: fit-content;
      min-height: 40px;
      border-radius: 10px;
      border: 1px solid #3a3a3a;
      padding: 0 14px;
      font-size: 14px;
      font-weight: 700;
      color: #fff;
      background: #121212;
      font-family: inherit;
    }

    .buildings-view {
      position: absolute;
      inset: 0;
      z-index: 25;
      background: #000;
      border-radius: 24px;
      overflow-y: auto;
    }

    .buildings-hero {
      min-height: 345px;
      padding: 12px 10px 16px;
      background:
        linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.82) 76%, #000 100%),
        var(--miniapp-buildings-bg, url('/miniapp/assets/cards/screen-buildings.png')),
        linear-gradient(135deg, #43424a 0%, #2e3038 35%, #1f2430 65%, #171b24 100%);
      background-position: center -10px;
      background-size: 124%;
      background-repeat: no-repeat;
      border-bottom: 1px solid #1e2430;
    }

    /* Unified bottom fade for all asset heroes: image starts from top and fades to black at bottom. */
    .buildings-hero,
    .warriors-hero,
    .clan-hero,
    .raids-hero,
    .evolution-hero,
    .shop-hero,
    .amber-hero {
      position: relative;
      overflow: hidden;
    }
    .buildings-hero::after,
    .warriors-hero::after,
    .clan-hero::after,
    .raids-hero::after,
    .evolution-hero::after,
    .shop-hero::after,
    .amber-hero::after {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      height: min(44%, 180px);
      background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.84) 72%, #000 100%);
      pointer-events: none;
      z-index: 0;
    }
    .buildings-hero > *,
    .warriors-hero > *,
    .clan-hero > *,
    .raids-hero > *,
    .evolution-hero > *,
    .shop-hero > *,
    .amber-hero > * {
      position: relative;
      z-index: 1;
    }

    .buildings-close {
      width: 34px;
      height: 34px;
      border-radius: 12px;
      border: 1px solid #313640;
      background: rgba(10, 10, 12, 0.45);
      color: #f8fbff;
      font-size: 21px;
      line-height: 1;
      display: grid;
      place-items: center;
      font-family: inherit;
      margin-top: 10px;
    }

    .buildings-title {
      margin: 182px 0 0;
      font-size: 52px;
      line-height: 0.95;
      font-weight: 800;
      letter-spacing: -0.02em;
    }

    .buildings-sub {
      margin: 8px 0 0;
      color: #ffb75d;
      font-weight: 700;
      font-size: 17px;
    }

    .buildings-list {
      padding: 10px;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .building-item {
      min-height: 146px;
      border: 1px solid #8b430f;
      border-radius: 24px;
      padding: 12px 12px 58px 78px;
      background: #07090f;
      position: relative;
    }

    .building-icon {
      position: absolute;
      top: 12px;
      left: 12px;
      width: 54px;
      height: 54px;
      border-radius: 16px;
      background: linear-gradient(180deg, #ff5f15 0%, #ea4b00 100%);
      display: grid;
      place-items: center;
      font-size: 26px;
    }

    .building-content { min-width: 0; }
    .building-title { font-size: clamp(20px, 5.5vw, 24px); font-weight: 800; line-height: 1.05; }
    .building-level { margin-top: 4px; font-size: 13px; font-weight: 700; color: #ffa541; }
    .building-timer { margin-top: 3px; font-size: 12px; color: #8eb4ff; font-weight: 700; }
    .building-desc { margin-top: 5px; font-size: 12px; color: #c3ccd9; font-weight: 600; line-height: 1.35; }
    .building-cost { margin-top: 4px; font-size: 12px; color: #9ca8bb; font-weight: 700; }

    .building-arrow {
      color: #9bacbf;
      font-size: 36px;
      line-height: 1;
      margin-right: 2px;
      flex: 0 0 auto;
    }

    .boost-btn {
      position: absolute;
      right: 12px;
      bottom: 12px;
      min-width: 94px;
      min-height: 42px;
      border: 0;
      border-radius: 16px;
      padding: 0 12px;
      font-size: 19px;
      font-weight: 800;
      font-family: inherit;
      background: linear-gradient(180deg, #ff6b1d 0%, #e95305 100%);
      color: #fff6ec;
      z-index: 2;
    }

    .boost-btn-placeholder {
      position: absolute;
      right: 12px;
      bottom: 12px;
      width: 1px;
      height: 1px;
      opacity: 0;
      pointer-events: none;
    }

    .warriors-view {
      position: absolute;
      inset: 0;
      z-index: 26;
      background: #000;
      border-radius: 24px;
      overflow-y: auto;
    }

    .warriors-hero {
      min-height: 352px;
      padding: 12px 10px 14px;
      background:
        linear-gradient(180deg, rgba(0,0,0,0.16) 0%, rgba(0,0,0,0.8) 76%, #000 100%),
        var(--miniapp-warriors-hero, url('/miniapp/assets/cards/screen-warriors.png')),
        linear-gradient(135deg, #494b50 0%, #252830 58%, #191c22 100%);
      background-position: center -10px;
      background-size: 118%;
      background-repeat: no-repeat;
      border-bottom: 1px solid #1e2430;
    }

    .warriors-close {
      width: 34px;
      height: 34px;
      border-radius: 12px;
      border: 1px solid #313640;
      background: rgba(10, 10, 12, 0.45);
      color: #f8fbff;
      font-size: 21px;
      line-height: 1;
      display: grid;
      place-items: center;
      font-family: inherit;
      margin-top: 8px;
    }

    .warriors-title {
      margin: 182px 0 0;
      font-size: clamp(25px, 8vw, 42px);
      line-height: 0.98;
      font-weight: 800;
      letter-spacing: -0.02em;
    }

    .warriors-sub {
      margin: 8px 0 0;
      color: #ffb75d;
      font-weight: 700;
      font-size: 16px;
    }

    .warriors-list {
      padding: 10px;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .warrior-rarity-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }
    .rarity-btn {
      min-height: 62px;
      border-radius: 16px;
      border: 1px solid #8b430f;
      background: #07090f;
      color: #fff;
      font-family: inherit;
      font-weight: 800;
      font-size: 16px;
      text-align: left;
      padding: 10px 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }
    .rarity-btn.active {
      border-color: #ff9a2f;
      box-shadow: inset 0 0 0 1px rgba(255, 154, 47, 0.4);
    }
    .rarity-btn .count { color: #ffb75d; font-size: 13px; font-weight: 700; }
    .rarity-back-btn {
      min-height: 52px;
      border-radius: 16px;
      border: 1px solid #8b430f;
      background: #07090f;
      color: #fff;
      font-family: inherit;
      font-size: 15px;
      font-weight: 800;
      text-align: left;
      padding: 0 14px;
    }
    .warrior-tools {
      display: grid;
      grid-template-columns: 1fr;
      gap: 10px;
    }
    .warrior-tool-btn {
      min-height: 40px;
      border-radius: 14px;
      border: 1px solid #8b430f;
      background: #07090f;
      color: #fff;
      font-family: inherit;
      font-size: 13px;
      font-weight: 800;
      text-align: left;
      padding: 0 10px;
    }
    .squad-ctrl {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }
    .squad-tab-btn, .squad-sort-select {
      min-height: 40px;
      border-radius: 14px;
      border: 1px solid #8b430f;
      background: #07090f;
      color: #fff;
      font-family: inherit;
      font-size: 13px;
      font-weight: 800;
      text-align: left;
      padding: 0 10px;
    }
    .squad-tab-btn.active {
      background: #141922;
      border-color: #ff6315;
    }
    .squad-pager {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }
    .squad-page-btn {
      min-height: 36px;
      min-width: 92px;
      border-radius: 12px;
      border: 1px solid #8b430f;
      background: #07090f;
      color: #fff;
      font-family: inherit;
      font-size: 12px;
      font-weight: 800;
    }
    .squad-page-label { color: #9ca6b8; font-size: 11px; font-weight: 700; }
    .warrior-modal {
      position: fixed;
      inset: 0;
      z-index: 120;
      background: rgba(0, 0, 0, 0.72);
      display: flex;
      align-items: flex-end;
      justify-content: center;
      padding: 14px 10px;
    }
    .warrior-modal-card {
      width: 100%;
      max-width: 420px;
      border-radius: 22px;
      border: 1px solid #8b430f;
      background: #07090f;
      padding: 14px;
      box-shadow: 0 12px 30px rgba(0, 0, 0, 0.48);
    }
    .warrior-modal-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }
    .warrior-modal-title { font-size: 24px; font-weight: 800; line-height: 1.05; }
    .warrior-modal-close {
      width: 34px;
      height: 34px;
      border-radius: 10px;
      border: 1px solid #313640;
      background: rgba(10, 10, 12, 0.45);
      color: #f8fbff;
      font-size: 19px;
      line-height: 1;
      display: grid;
      place-items: center;
      font-family: inherit;
    }
    .warrior-modal-meta {
      margin-top: 8px;
      color: #ffb75d;
      font-weight: 700;
      font-size: 13px;
    }
    .warrior-modal-portrait {
      margin-top: 10px;
      width: 100%;
      aspect-ratio: 9 / 10;
      border-radius: 14px;
      border: 1px solid #2b3342;
      background: #0b0f18;
      overflow: hidden;
    }
    .warrior-modal-portrait img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center top;
      display: block;
    }
    .warrior-modal-portrait.view-hidden {
      display: none;
    }
    .warrior-modal-lore {
      margin-top: 10px;
      padding: 10px;
      border-radius: 12px;
      border: 1px solid #2b3342;
      background: #0f131d;
      color: #d7deeb;
      font-size: 12px;
      line-height: 1.35;
      font-weight: 600;
      white-space: pre-wrap;
    }
    .warrior-modal-stats {
      margin-top: 10px;
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 10px;
    }
    .warrior-modal-actions {
      margin-top: 14px;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }
    .warrior-action-btn {
      min-height: 46px;
      border-radius: 14px;
      border: 1px solid #8b430f;
      background: #0f131d;
      color: #fff;
      font-family: inherit;
      font-size: 14px;
      font-weight: 800;
    }
    .warrior-action-btn.primary {
      border: 0;
      background: linear-gradient(180deg, #ff6315 0%, #ef4400 100%);
    }
    .warrior-card-actions {
      grid-template-columns: 1fr;
    }
    .warrior-card-actions .warrior-action-btn {
      width: 100%;
    }
    .warrior-card-view {
      position: absolute;
      inset: 0;
      z-index: 27;
      background: #000;
      border-radius: 24px;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }
    .warrior-card-meta {
      margin-top: 2px;
      color: #ffb75d;
      font-weight: 700;
      font-size: 13px;
      line-height: 1.35;
    }
    .warrior-card-title {
      margin: 0;
      font-size: clamp(25px, 8vw, 42px);
      line-height: 0.98;
      font-weight: 800;
      letter-spacing: -0.02em;
    }
    .warrior-card-portrait {
      width: 100%;
      aspect-ratio: 9 / 10;
      border-radius: 14px;
      border: 1px solid #2b3342;
      background: #0b0f18;
      overflow: hidden;
    }
    .warrior-card-portrait img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center top;
      display: block;
    }
    .warrior-card-portrait.view-hidden {
      display: none;
    }
    .warrior-card-skills {
      margin-top: 12px;
      padding: 12px;
      border-radius: 16px;
      border: 1px solid #2b3342;
      background: #0f131d;
    }
    .warrior-card-skills-title {
      font-size: 14px;
      font-weight: 800;
      color: #f3f6ff;
      margin-bottom: 10px;
    }
    .warrior-skills-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }
    .warrior-skill-btn {
      min-height: 72px;
      border-radius: 12px;
      border: 1px solid #394255;
      background: #121826;
      color: #eef3ff;
      font-family: inherit;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 4px;
      text-align: center;
      padding: 6px;
    }
    .warrior-skill-icon {
      font-size: 20px;
      line-height: 1;
    }
    .warrior-skill-name {
      font-size: 11px;
      font-weight: 700;
      line-height: 1.2;
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .skill-context-menu {
      margin-top: 10px;
      border-radius: 14px;
      border: 1px solid #44516c;
      background: #131a29;
      padding: 10px;
    }
    .skill-context-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }
    .skill-context-title {
      font-size: 16px;
      font-weight: 800;
      color: #f4f6ff;
    }
    .skill-context-body {
      margin-top: 8px;
      color: #cdd6e8;
      font-size: 13px;
      line-height: 1.4;
      white-space: pre-wrap;
    }
    .skill-context-close {
      width: 30px;
      height: 30px;
      border-radius: 10px;
      border: 1px solid #4b566e;
      background: #1a2336;
      color: #fff;
      font-family: inherit;
      font-size: 18px;
      line-height: 1;
      font-weight: 800;
      flex: 0 0 auto;
    }
    .warrior-skill-btn.active {
      border-color: #ff9a2f;
      box-shadow: inset 0 0 0 1px rgba(255, 154, 47, 0.4);
    }
    .warriors-note {
      margin: 2px 2px 0;
      color: #9ca6b8;
      font-size: 12px;
      font-weight: 700;
      min-height: 16px;
    }

    .squad-card {
      border: 1px solid #8b430f;
      border-radius: 24px;
      padding: 14px;
      background: #07090f;
      cursor: pointer;
    }

    .squad-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .squad-label { font-size: 17px; color: #9ca6b8; margin-bottom: 3px; }
    .squad-count { font-size: 42px; line-height: 1; font-weight: 800; }
    .squad-shield {
      width: 68px;
      height: 68px;
      border-radius: 17px;
      background: linear-gradient(180deg, #ff5f15 0%, #ea4b00 100%);
      display: grid;
      place-items: center;
      font-size: 34px;
    }

    .squad-stats {
      margin-top: 12px;
      display: grid;
      grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
      gap: 10px;
    }

    .sstat {
      min-height: 76px;
      border-radius: 16px;
      background: #151922;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
    }
    .sstat-val { font-size: 30px; font-weight: 800; line-height: 1; }
    .sstat-label { margin-top: 3px; font-size: 12px; color: #aab2c2; font-weight: 700; }
    .sstat-attack { color: #ff5b5b; }
    .sstat-defense { color: #4a92ff; }
    .sstat-health { color: #38e89e; }

    .warrior-item {
      min-height: 98px;
      border: 1px solid #8b430f;
      border-radius: 24px;
      padding: 12px;
      background: #07090f;
      width: 100%;
      color: #fff;
      font-family: inherit;
      text-align: left;
      display: flex;
      align-items: center;
      gap: 12px;
      position: relative;
      transition: filter 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
    }
    .warrior-item.common { border-color: #7f8a9d; background: linear-gradient(135deg, #121720 0%, #1b2230 100%); }
    .warrior-item.uncommon { border-color: #2fb764; background: linear-gradient(135deg, #0f2e1d 0%, #184328 100%); }
    .warrior-item.rare { border-color: #2b78ff; background: linear-gradient(135deg, #062041 0%, #0f2f58 100%); }
    .warrior-item.epic { border-color: #8d39ff; background: linear-gradient(135deg, #26002d 0%, #4c0054 100%); }
    .warrior-item.legendary { border-color: #f5b328; background: linear-gradient(135deg, #3b2b0e 0%, #5b4114 100%); }
    .warrior-icon {
      width: 54px;
      height: 54px;
      border-radius: 16px;
      background: #1b1f2b;
      display: grid;
      place-items: center;
      font-size: 26px;
      flex: 0 0 auto;
      overflow: hidden;
    }
    .warrior-icon img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center top;
      display: block;
    }
    .warrior-item.is-owned {
      filter: saturate(1.08) brightness(1.06);
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
    }
    .warrior-item.is-locked {
      filter: saturate(0.72) brightness(0.82);
      opacity: 0.9;
    }
    .warrior-owned-badge {
      position: absolute;
      top: 8px;
      right: 8px;
      width: 26px;
      height: 26px;
      border-radius: 9px;
      border: 1px solid rgba(255, 255, 255, 0.32);
      background: rgba(8, 20, 16, 0.72);
      display: grid;
      place-items: center;
      font-size: 14px;
      line-height: 1;
      color: #d7ffe7;
      pointer-events: none;
    }
    .warrior-content { flex: 1; min-width: 0; }
    .warrior-name { font-size: 24px; line-height: 1.04; font-weight: 800; }
    .warrior-meta { margin-top: 4px; font-size: 13px; color: #ffb953; font-weight: 700; }
    .warrior-meta .pow { color: #9da9bf; margin-left: 10px; }
    .warrior-arrow { color: #9bacbf; font-size: 36px; line-height: 1; margin-right: 2px; }

    .scout-btn {
      min-height: 84px;
      border: 0;
      border-radius: 22px;
      padding: 12px 14px;
      background: linear-gradient(180deg, #ff6315 0%, #ef4400 100%);
      color: #fff;
      font-family: inherit;
      text-align: left;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      box-shadow: 0 10px 26px rgba(230, 74, 0, 0.35);
    }
    .scout-title { font-size: 24px; font-weight: 800; line-height: 1; }
    .scout-sub { margin-top: 3px; font-size: 13px; font-weight: 700; color: #ffe3c4; }
    .scout-sub strong { color: #fff8ee; }
    .scout-icon {
      width: 58px;
      height: 58px;
      border-radius: 17px;
      background: rgba(255,255,255,0.18);
      display: grid;
      place-items: center;
      font-size: 30px;
      flex: 0 0 auto;
    }
    .squad-modal {
      position: fixed;
      inset: 0;
      z-index: 121;
      background: rgba(0, 0, 0, 0.72);
      display: flex;
      align-items: flex-end;
      justify-content: center;
      padding: 14px 10px;
    }
    .squad-modal-card {
      width: 100%;
      max-width: 420px;
      border-radius: 22px;
      border: 1px solid #8b430f;
      background: #07090f;
      padding: 14px;
      box-shadow: 0 12px 30px rgba(0, 0, 0, 0.48);
      max-height: 80vh;
      overflow: auto;
    }
    .squad-modal-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }
    .squad-modal-title { font-size: 20px; font-weight: 800; line-height: 1.05; }
    .squad-modal-close {
      width: 34px;
      height: 34px;
      border-radius: 10px;
      border: 1px solid #313640;
      background: rgba(10, 10, 12, 0.45);
      color: #f8fbff;
      font-size: 19px;
      line-height: 1;
      display: grid;
      place-items: center;
      font-family: inherit;
    }
    .squad-modal-subhead {
      margin-top: 10px;
      font-size: 13px;
      color: #ffb75d;
      font-weight: 700;
    }
    .squad-modal-tools {
      margin-top: 8px;
      display: flex;
      justify-content: flex-end;
    }
    .squad-modal-sort {
      min-height: 34px;
      border-radius: 10px;
      border: 1px solid #8b430f;
      background: #0f131d;
      color: #fff;
      font-family: inherit;
      font-size: 12px;
      font-weight: 700;
      padding: 0 10px;
    }
    .squad-modal-list {
      margin-top: 8px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .squad-row {
      min-height: 64px;
      border-radius: 14px;
      border: 1px solid #8b430f;
      background: #111521;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 8px 10px;
    }
    .squad-row-name { font-size: 15px; font-weight: 800; }
    .squad-row-meta { margin-top: 3px; color: #9ca6b8; font-size: 12px; font-weight: 700; }
    .squad-row-btn {
      min-height: 34px;
      border-radius: 10px;
      border: 1px solid #8b430f;
      background: #0f131d;
      color: #fff;
      font-family: inherit;
      font-size: 12px;
      font-weight: 800;
      padding: 0 10px;
      white-space: nowrap;
    }
    .squad-row-btn.primary {
      border: 0;
      background: linear-gradient(180deg, #ff6315 0%, #ef4400 100%);
    }
    .squad-row.rarity-common { border-color: #7f8a9d; background: #151922; }
    .squad-row.rarity-uncommon { border-color: #2fb764; background: #0f2e1d; }
    .squad-row.rarity-rare { border-color: #2b78ff; background: #0f213f; }
    .squad-row.rarity-epic { border-color: #8d39ff; background: #24113a; }
    .squad-row.rarity-legendary { border-color: #f5b328; background: #3a2a0f; }

    .raid-result-modal {
      position: absolute;
      inset: 0;
      z-index: 35;
      background: rgba(0, 0, 0, 0.56);
      display: grid;
      place-items: center;
      padding: 16px;
    }

    .raid-result-card {
      width: 100%;
      max-width: 340px;
      border: 1px solid #2f3748;
      border-radius: 18px;
      background: linear-gradient(180deg, #111521 0%, #0b1019 100%);
      padding: 14px 12px 12px;
      box-shadow: 0 16px 42px rgba(0, 0, 0, 0.52);
    }

    .raid-result-title {
      font-size: 22px;
      line-height: 1;
      font-weight: 800;
      color: #fff3e5;
    }

    .raid-result-body {
      margin-top: 10px;
      color: #d4deee;
      font-size: 13px;
      font-weight: 700;
      line-height: 1.35;
      white-space: pre-line;
    }

    .raid-result-actions {
      margin-top: 12px;
      display: flex;
      justify-content: flex-end;
    }

    .raid-result-close {
      min-height: 36px;
      border: 0;
      border-radius: 12px;
      padding: 0 12px;
      font-size: 14px;
      font-weight: 800;
      font-family: inherit;
      color: #fff7f0;
      background: linear-gradient(180deg, #ff6315 0%, #ef4400 100%);
    }

    .confirm-modal {
      position: fixed;
      inset: 0;
      z-index: 122;
      background: rgba(0, 0, 0, 0.72);
      display: grid;
      place-items: center;
      padding: 16px;
    }
    .confirm-card {
      width: 100%;
      max-width: 340px;
      border-radius: 18px;
      border: 1px solid #8b430f;
      background: linear-gradient(180deg, #111521 0%, #0b1019 100%);
      padding: 14px 12px 12px;
      box-shadow: 0 16px 42px rgba(0, 0, 0, 0.52);
    }
    .confirm-title {
      font-size: 22px;
      line-height: 1;
      font-weight: 800;
      color: #fff3e5;
    }
    .confirm-body {
      margin-top: 10px;
      color: #d4deee;
      font-size: 13px;
      font-weight: 700;
      line-height: 1.35;
      white-space: pre-line;
    }
    .confirm-actions {
      margin-top: 12px;
      display: flex;
      justify-content: flex-end;
      gap: 8px;
    }

    .settings-view {
      position: absolute;
      inset: 0;
      z-index: 27;
      border-radius: 24px;
      overflow-y: auto;
      background: linear-gradient(180deg, #0d1016 0%, #090c12 100%);
      padding: 12px 10px 24px;
    }
    #settings-view .top .settings {
      margin-left: auto;
    }
    .admin-map-view {
      position: absolute;
      inset: 0;
      z-index: 26;
      border-radius: 24px;
      overflow: hidden;
      background: #000;
      padding: 0;
    }
    .admin-map-event-entry {
      position: absolute;
      left: 10px;
      top: calc(78px + env(safe-area-inset-top, 0px));
      width: 46px;
      height: 46px;
      border-radius: 999px;
      border: 1px solid rgba(157, 66, 20, 0.85);
      background: linear-gradient(180deg, #ff7a22 0%, #d94b00 100%);
      box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
      color: #fff7ef;
      font-size: 22px;
      line-height: 1;
      display: grid;
      place-items: center;
      z-index: 5;
      font-family: inherit;
      cursor: pointer;
    }
    .admin-map-meta-bar {
      position: absolute;
      left: 0;
      right: 0;
      top: calc(30px + env(safe-area-inset-top, 0px));
      z-index: 2;
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 4px;
      min-height: 34px;
      border-radius: 0;
      border: 1px solid rgba(64, 82, 116, 0.62);
      background: rgba(8, 14, 22, 0.86);
      padding: 3px 6px;
    }
    .admin-map-meta-item {
      min-height: 26px;
      border-radius: 0;
      border: 1px solid rgba(74, 96, 135, 0.42);
      background: rgba(12, 19, 30, 0.86);
      padding: 0 6px;
      color: #e4ecfb;
      text-align: center;
      font-family: inherit;
      display: grid;
      place-items: center;
      align-items: center;
      justify-content: center;
    }
    .admin-map-meta-item.is-link {
      cursor: pointer;
    }
    #admin-map-meta-tribe-btn {
      border-color: #9a410e;
      background: linear-gradient(180deg, #ff7a22 0%, #e95a07 100%);
      box-shadow: inset 0 1px 0 rgba(255, 198, 151, 0.45);
    }
    #admin-map-meta-tribe-btn .admin-map-meta-value {
      color: #fff3e8;
    }
    .admin-map-meta-value {
      font-size: 12px;
      line-height: 1.1;
      font-weight: 800;
      color: #f3f7ff;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 100%;
    }
    #admin-map-meta-power,
    #admin-map-meta-rating {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
    }
    #admin-map-meta-power::before,
    #admin-map-meta-rating::before {
      line-height: 1;
      font-size: 12px;
      opacity: 0.96;
    }
    #admin-map-meta-power::before {
      content: "⚔";
    }
    #admin-map-meta-rating::before {
      content: "🏆";
    }
    .admin-map-view > .resources {
      position: absolute;
      left: 0;
      right: 0;
      top: 0;
      z-index: 2;
      margin-top: 0;
      padding: calc(4px + env(safe-area-inset-top, 0px)) 8px 5px;
      background: linear-gradient(180deg, rgba(7, 12, 20, 0.92) 0%, rgba(7, 12, 20, 0.68) 100%);
      border-bottom: 1px solid rgba(64, 82, 116, 0.55);
      backdrop-filter: blur(2px);
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 3px;
    }
    .admin-map-view > .resources .res {
      min-height: 22px;
      border-radius: 8px;
      gap: 2px;
      padding: 0 1px;
      font-size: 9px;
    }
    .admin-map-view > .resources .res span:first-child {
      font-size: 10px;
      line-height: 1;
    }
    .admin-map-view > .resources .res span:last-child {
      font-size: 11px;
      line-height: 1;
    }
    .admin-map-view .tabbar {
      left: 0;
      right: 0;
      bottom: 0;
      margin: 0;
      padding: 0 0 env(safe-area-inset-bottom, 0px);
      background: linear-gradient(0deg, rgba(7, 12, 20, 0.96) 0%, rgba(7, 12, 20, 0.8) 100%);
      border-top: 1px solid rgba(64, 82, 116, 0.55);
      z-index: 6;
    }
    .admin-map-view .tabbar .tabs {
      gap: 0;
      padding: 0;
      background: transparent;
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .admin-map-view .tabbar .tab {
      min-height: 58px;
      border: 0;
      border-right: 1px solid rgba(56, 72, 100, 0.55);
      border-radius: 0;
      background: transparent;
    }
    .admin-map-view .tabbar .tab:last-child {
      border-right: 0;
    }
    .admin-map-stage {
      width: 100%;
      height: 100%;
      border-radius: 0;
      background: #000;
      position: relative;
      overflow: hidden;
      touch-action: none;
      user-select: none;
      -webkit-user-select: none;
      -webkit-touch-callout: none;
    }
    .admin-map-image {
      position: absolute;
      left: 0;
      top: 0;
      transform-origin: 0 0;
      will-change: transform;
      user-select: none;
      -webkit-user-drag: none;
      pointer-events: none;
      max-width: none;
    }
    .admin-map-overlay {
      position: absolute;
      left: 0;
      top: 0;
      transform-origin: 0 0;
      pointer-events: none;
      max-width: none;
      will-change: transform;
    }
    .admin-map-grid-svg {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      overflow: visible;
    }
    .admin-map-grid-line {
      stroke: rgba(0, 0, 0, 0.82);
      stroke-width: 1.6;
      vector-effect: non-scaling-stroke;
    }
    .admin-map-grid-cell {
      stroke-width: 1.2;
      vector-effect: non-scaling-stroke;
    }
    .admin-map-grid-cell.is-valid {
      fill: rgba(39, 186, 94, 0.24);
      stroke: rgba(27, 137, 72, 0.84);
    }
    .admin-map-grid-cell.is-invalid {
      fill: rgba(217, 62, 62, 0.24);
      stroke: rgba(151, 36, 36, 0.84);
    }
    .admin-map-grid-cell.is-occupied {
      fill: rgba(66, 92, 136, 0.2);
      stroke: rgba(47, 71, 109, 0.62);
    }
    .admin-map-grid-border {
      fill: rgba(0, 0, 0, 0.05);
      stroke: rgba(0, 0, 0, 0.96);
      stroke-width: 4;
      vector-effect: non-scaling-stroke;
    }
    .admin-map-zone-svg {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      overflow: visible;
    }
    .admin-map-zone-poly {
      fill: transparent;
      stroke: transparent;
      stroke-width: 3;
      stroke-linejoin: round;
    }
    .admin-map-campfire-btn {
      position: absolute;
      width: 152px;
      height: 152px;
      margin-left: -76px;
      margin-top: -76px;
      border: 0;
      padding: 0;
      background: transparent;
      display: block;
      pointer-events: none;
      cursor: default;
    }
    .admin-map-placed-layer {
      position: absolute;
      inset: 0;
      pointer-events: none;
    }
    .admin-map-placed-item {
      position: absolute;
      transform: translate(-50%, -50%);
      pointer-events: none;
      filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.45));
    }
    .admin-map-placed-item img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: block;
      user-select: none;
      -webkit-user-drag: none;
    }
    .admin-map-placed-badge {
      position: absolute;
      left: 50%;
      bottom: 24px;
      transform: translateX(-50%);
      min-height: 18px;
      border-radius: 999px;
      border: 1px solid #385a99;
      background: rgba(6, 12, 20, 0.86);
      color: #b7d7ff;
      font-size: 11px;
      font-weight: 800;
      line-height: 1;
      padding: 3px 8px;
      white-space: nowrap;
    }
    .admin-map-placed-badge.level {
      border-color: #7a5523;
      background: rgba(20, 14, 8, 0.9);
      color: #ffd299;
    }
    .admin-map-campfire-img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: block;
      filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.45));
      user-select: none;
      -webkit-user-drag: none;
    }
    .admin-map-campfire-timer {
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
      min-height: 18px;
      border-radius: 999px;
      border: 1px solid #385a99;
      background: rgba(6, 12, 20, 0.86);
      color: #b7d7ff;
      font-size: 11px;
      font-weight: 800;
      line-height: 1;
      padding: 3px 8px;
      white-space: nowrap;
      pointer-events: none;
    }
    .admin-map-campfire-timer.level {
      border-color: #7a5523;
      background: rgba(20, 14, 8, 0.9);
      color: #ffd299;
    }
    .admin-map-camp-modal-card {
      width: min(92vw, 360px);
      border-radius: 18px;
      border: 1px solid #3c2c21;
      background: linear-gradient(180deg, #0f151f 0%, #0b1017 100%);
      padding: 14px 12px 12px;
      box-shadow: 0 14px 38px rgba(0, 0, 0, 0.45);
    }
    #admin-map-camp-modal .confirm-close,
    #admin-map-build-picker-modal .confirm-close {
      display: none;
    }
    .admin-map-camp-modal-title {
      font-size: 24px;
      font-weight: 800;
      line-height: 1.05;
      color: #fff3e6;
    }
    .admin-map-camp-modal-level {
      margin-top: 4px;
      color: #ffb45a;
      font-size: 13px;
      font-weight: 700;
    }
    .admin-map-camp-modal-preview {
      margin-top: 10px;
      width: 72px;
      height: 72px;
      border-radius: 12px;
      border: 1px solid #3a4f76;
      background: #0f1623;
      display: grid;
      place-items: center;
      overflow: hidden;
    }
    .admin-map-camp-modal-preview img {
      width: 88%;
      height: 88%;
      object-fit: contain;
      display: block;
      filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
      user-select: none;
      -webkit-user-drag: none;
    }
    .admin-map-camp-modal-desc {
      margin-top: 8px;
      color: #d5deee;
      font-size: 13px;
      font-weight: 600;
      line-height: 1.35;
      white-space: pre-line;
    }
    .admin-map-camp-modal-cost {
      margin-top: 6px;
      color: #9ca8bb;
      font-size: 12px;
      font-weight: 700;
      line-height: 1.3;
    }
    .admin-map-camp-modal-timer {
      margin-top: 8px;
      color: #9cc4ff;
      font-size: 12px;
      font-weight: 700;
      min-height: 16px;
    }
    .admin-map-camp-modal-actions {
      margin-top: 12px;
      display: flex;
      justify-content: flex-end;
      gap: 8px;
    }
    .admin-map-camp-modal-move {
      border-color: #31598f !important;
      background: linear-gradient(180deg, #20395d 0%, #172a44 100%) !important;
      color: #dbe7ff !important;
    }
    .admin-map-preview {
      position: absolute;
      transform: translate(-50%, -50%);
      border-radius: 0;
      border: 0;
      background: transparent;
      box-shadow: none;
      pointer-events: none;
      overflow: visible;
      transition: left 100ms linear, top 100ms linear, width 100ms ease, height 100ms ease;
    }
    .admin-map-preview img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: block;
      opacity: 0.92;
      user-select: none;
      -webkit-user-drag: none;
    }
    .admin-map-placement-actions {
      position: absolute;
      left: 0;
      top: 0;
      transform: translate(-50%, 0);
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 116px;
      gap: 14px;
      z-index: 4;
      pointer-events: none;
      transition: left 100ms linear, top 100ms linear;
    }
    .admin-map-placement-btn {
      width: 48px;
      height: 48px;
      border-radius: 50%;
      border: 1px solid #7a3012;
      background: linear-gradient(180deg, #ff7d26 0%, #f85f05 100%);
      color: #fff2e4;
      font-size: 24px;
      line-height: 1;
      font-weight: 900;
      display: grid;
      place-items: center;
      pointer-events: auto;
      box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
      padding: 0;
    }
    .admin-map-placement-btn.cancel {
      border-color: #4e535f;
      background: linear-gradient(180deg, #2a2f3a 0%, #1e232d 100%);
      color: #e2e7f2;
    }
    .admin-map-move-handle {
      position: absolute;
      left: 0;
      top: 0;
      transform: translate(-50%, 0);
      width: 44px;
      height: 44px;
      border-radius: 50%;
      border: 1px solid #2f4d86;
      background: linear-gradient(180deg, #1e365f 0%, #172944 100%);
      color: #dceaff;
      font-size: 22px;
      font-weight: 900;
      line-height: 1;
      display: grid;
      place-items: center;
      box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
      z-index: 5;
      padding: 0;
      pointer-events: auto;
    }
    .admin-map-watchpost-actions {
      position: absolute;
      left: 0;
      top: 0;
      transform: translate(-50%, 0);
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 116px;
      gap: 14px;
      z-index: 5;
      pointer-events: none;
      transition: left 100ms linear, top 100ms linear;
    }
    .admin-map-watchpost-btn {
      width: 48px;
      height: 48px;
      border-radius: 50%;
      border: 1px solid #2f4d86;
      background: linear-gradient(180deg, #1e365f 0%, #172944 100%);
      color: #dceaff;
      font-size: 20px;
      font-weight: 900;
      line-height: 1;
      display: grid;
      place-items: center;
      pointer-events: auto;
      box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
      padding: 0;
    }
    .admin-map-watchpost-btn.manage {
      border-color: #31598f;
      background: linear-gradient(180deg, #23406c 0%, #1a3153 100%);
    }
    .admin-map-build-btn {
      position: absolute;
      right: 18px;
      bottom: calc(132px + env(safe-area-inset-bottom, 0px));
      width: 35px;
      height: 35px;
      border-radius: 50%;
      border: 1px solid #7a3012;
      background: linear-gradient(180deg, #ff7d26 0%, #f85f05 100%);
      color: #fff2e4;
      font-size: 17px;
      line-height: 1;
      font-weight: 900;
      display: grid;
      place-items: center;
      box-shadow: 0 10px 20px rgba(0, 0, 0, 0.36);
      z-index: 5;
      padding: 0;
    }
    .admin-map-reset-btn {
      position: absolute;
      right: 18px;
      bottom: calc(174px + env(safe-area-inset-bottom, 0px));
      width: 35px;
      height: 35px;
      border-radius: 50%;
      border: 1px solid #2e4f87;
      background: linear-gradient(180deg, #24406c 0%, #182c49 100%);
      color: #e4efff;
      font-size: 16px;
      line-height: 1;
      font-weight: 900;
      display: grid;
      place-items: center;
      box-shadow: 0 10px 20px rgba(0, 0, 0, 0.36);
      z-index: 5;
      padding: 0;
    }
    .admin-map-build-picker-card {
      width: min(92vw, 360px);
      border-radius: 18px;
      border: 1px solid #3c2c21;
      background: linear-gradient(180deg, #0f151f 0%, #0b1017 100%);
      padding: 14px 12px 12px;
      box-shadow: 0 14px 38px rgba(0, 0, 0, 0.45);
    }
    .admin-map-build-picker-title {
      font-size: 22px;
      font-weight: 800;
      line-height: 1.05;
      color: #fff3e6;
    }
    .admin-map-build-picker-grid {
      margin-top: 12px;
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
    }
    .admin-map-build-tile {
      position: relative;
      border-radius: 12px;
      border: 1px solid #37445e;
      background: #111722;
      min-height: 96px;
      padding: 6px 6px 8px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-between;
      color: #e8eefb;
      font-size: 11px;
      font-weight: 700;
      text-align: center;
      gap: 6px;
    }
    .admin-map-build-tile.is-built {
      border-color: #3f7e47;
      background: #102216;
      color: #d9ffe0;
    }
    .admin-map-build-tile.is-built::after {
      content: "✓";
      position: absolute;
      top: 4px;
      right: 7px;
      width: 16px;
      height: 16px;
      border-radius: 50%;
      display: grid;
      place-items: center;
      font-size: 11px;
      font-weight: 900;
      color: #05210c;
      background: #8dffb0;
      border: 1px solid #4cb66f;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
    }
    .admin-map-build-tile img {
      width: 54px;
      height: 54px;
      object-fit: contain;
      display: block;
      filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
    }
    .admin-map-build-tile .tile-meta {
      font-size: 10px;
      color: #98a9c6;
      font-weight: 700;
      line-height: 1.1;
    }
    .admin-map-build-tile.is-empty {
      border-style: dashed;
      color: #8a95aa;
      background: #0d1119;
    }
    .settings-title {
      margin: 14px 0 0;
      font-size: 34px;
      line-height: 1;
      letter-spacing: -0.02em;
      font-weight: 800;
    }
    .settings-sub {
      margin: 8px 0 0;
      color: #ffbb6f;
      font-size: 14px;
      font-weight: 700;
    }
    .settings-list {
      margin-top: 16px;
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
    }
    .settings-item-btn {
      aspect-ratio: 1 / 1;
      border-radius: 16px;
      border: 1px solid #2f3a50;
      background: #12192a;
      color: #f2f6ff;
      font-family: inherit;
      font-size: 30px;
      font-weight: 800;
      text-align: center;
      padding: 0;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .settings-item-btn span {
      display: none;
      color: #9ba8c3;
      font-size: 10px;
      font-weight: 700;
      line-height: 1.3;
    }
    .backpack-view {
      position: absolute;
      inset: 0;
      z-index: 27;
      border-radius: 24px;
      overflow-y: auto;
      background: linear-gradient(180deg, #0d1016 0%, #090c12 100%);
      padding: 12px 10px 24px;
    }
    #backpack-view .top {
      align-items: center;
      gap: 8px;
    }
    #backpack-view .top .settings {
      margin-left: 8px;
      flex: 0 0 auto;
    }
    .backpack-title {
      margin: 14px 0 0;
      font-size: 34px;
      line-height: 1;
      letter-spacing: -0.02em;
      font-weight: 800;
    }
    .backpack-sub {
      margin: 8px 0 0;
      color: #ffbb6f;
      font-size: 14px;
      font-weight: 700;
    }
    .backpack-tabs {
      margin-top: 0;
      display: flex;
      align-items: center;
      gap: 8px;
      flex: 1 1 auto;
      min-width: 0;
      overflow-x: auto;
      overflow-y: hidden;
      white-space: nowrap;
      padding-bottom: 0;
      scrollbar-width: thin;
    }
    .backpack-tab {
      min-height: 34px;
      border-radius: 12px;
      border: 1px solid #2f3a50;
      background: #12192a;
      color: #d9e4ff;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex: 0 0 auto;
      text-decoration: none;
      font-family: inherit;
      font-size: 12px;
      font-weight: 800;
      padding: 0 12px;
      text-align: center;
    }
    .backpack-tab.active {
      border-color: #8b430f;
      background: linear-gradient(180deg, #ff6b1d 0%, #e95305 100%);
      color: #fff7ef;
    }
    .backpack-grid {
      margin-top: 12px;
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 8px;
    }
    .backpack-item {
      border-radius: 0;
      border: 0;
      background: transparent;
      padding: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      min-height: 0;
    }
    .backpack-item-icon {
      width: 56px;
      height: 56px;
      border-radius: 12px;
      border: 1px solid #3a4762;
      background: linear-gradient(180deg, #12192a 0%, #0f1522 100%);
      display: flex;
      align-items: flex-start;
      justify-content: center;
      font-size: 26px;
      line-height: 1;
      position: relative;
      padding: 5px 4px 17px;
      color: #eef3ff;
      font-family: inherit;
      cursor: pointer;
    }
    .backpack-item-glyph {
      line-height: 1;
      font-size: inherit;
    }
    .backpack-item-icon-badge {
      position: absolute;
      right: -3px;
      top: -3px;
      min-width: 20px;
      height: 17px;
      border-radius: 9px;
      border: 1px solid #5f2d0b;
      background: linear-gradient(180deg, #ff6b1d 0%, #e95305 100%);
      color: #fff8ef;
      font-size: 9px;
      font-weight: 800;
      line-height: 15px;
      text-align: center;
      padding: 0 5px;
      pointer-events: none;
    }
    .backpack-item-open-size {
      position: absolute;
      left: 4px;
      top: 3px;
      min-width: 18px;
      height: 14px;
      border-radius: 7px;
      border: 1px solid #2f3a50;
      background: rgba(8, 12, 20, 0.86);
      color: #d9e4ff;
      font-size: 8px;
      font-weight: 800;
      line-height: 12px;
      text-align: center;
      padding: 0 4px;
      pointer-events: none;
    }
    .backpack-item-title {
      position: absolute;
      left: 4px;
      right: 4px;
      bottom: 3px;
      text-align: center;
      font-size: 8px;
      font-weight: 700;
      color: #d5deef;
      line-height: 1.1;
      overflow: hidden;
      display: -webkit-box;
      -webkit-line-clamp: 1;
      -webkit-box-orient: vertical;
      pointer-events: none;
    }
    .backpack-item.is-empty .backpack-item-icon {
      opacity: 0.6;
    }
    .chat-launcher {
      position: absolute;
      left: 10px;
      right: 10px;
      bottom: calc(118px + env(safe-area-inset-bottom, 0px));
      z-index: 30;
    }
    .chat-launcher.is-admin-map {
      left: 0;
      right: 0;
    }
    .chat-launcher-btn {
      width: 100%;
      min-height: 52px;
      border-radius: 16px;
      border: 1px solid #2f3a50;
      background: rgba(8, 12, 20, 0.94);
      color: #f3f7ff;
      font-family: inherit;
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      text-align: left;
    }
    .chat-launcher.is-admin-map .chat-launcher-btn {
      border-radius: 0;
    }
    .chat-launcher-btn.has-notice {
      border-color: #8b430f;
      box-shadow: 0 0 0 1px rgba(255, 110, 22, 0.25), 0 8px 20px rgba(255, 110, 22, 0.18);
    }
    .chat-launcher-title {
      font-size: 13px;
      font-weight: 800;
      color: #ffd29b;
      white-space: nowrap;
      flex: 0 0 auto;
    }
    .chat-launcher-preview {
      font-size: 12px;
      font-weight: 700;
      color: #d1dbed;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      flex: 1 1 auto;
    }
    .chat-overlay {
      position: absolute;
      inset: 0;
      z-index: 35;
      border-radius: 24px;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      background:
        linear-gradient(180deg, rgba(4, 5, 7, 0.70) 0%, rgba(4, 5, 7, 0.70) 100%),
        url("/miniapp/assets/cards/chat-bg.png"),
        #040507;
      background-position: center top;
      background-size: cover;
      background-repeat: no-repeat;
      touch-action: pan-y;
      overscroll-behavior: contain;
    }
    .chat-top {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: calc(10px + env(safe-area-inset-top, 0px)) 10px 10px;
      border-bottom: 1px solid #1f2633;
      background: #0b0f18;
    }
    .chat-tabs {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      flex: 1 1 auto;
    }
    .chat-tab-btn {
      min-height: 36px;
      border-radius: 12px;
      border: 1px solid #33425c;
      background: #101727;
      color: #dfe8fb;
      font-family: inherit;
      font-size: 12px;
      font-weight: 800;
      padding: 0 10px;
    }
    .chat-tab-btn.active {
      border-color: #8b430f;
      background: linear-gradient(180deg, #ff6b1d 0%, #e95305 100%);
      color: #fff7ef;
    }
    .chat-close-btn {
      width: 34px;
      height: 34px;
      border-radius: 12px;
      border: 1px solid #3a2d22;
      background: #111318;
      color: #ff8b2f;
      font-family: inherit;
      font-size: 22px;
      font-weight: 800;
      line-height: 1;
      padding: 0;
      flex: 0 0 auto;
    }
    .chat-messages {
      flex: 1 1 auto;
      overflow-y: auto;
      padding: 10px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      background: transparent;
    }
    .chat-bubble {
      max-width: 88%;
      border-radius: 14px;
      border: 1px solid #2a3242;
      background: #0f1522;
      padding: 7px 10px;
      font-size: 12px;
      line-height: 1.35;
      color: #eef3ff;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
      align-self: flex-start;
      touch-action: pan-y;
      transition: transform 120ms ease;
    }
    .chat-bubble.mine {
      align-self: flex-end;
      border-color: #8b430f;
      background: #2a160d;
    }
    .chat-bubble-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      font-size: 11px;
      font-weight: 800;
      color: #ffb866;
      margin-bottom: 3px;
    }
    .chat-bubble-head-main {
      min-width: 0;
      flex: 1 1 auto;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .chat-bubble-head-avatar {
      width: 18px;
      height: 18px;
      border-radius: 999px;
      border: 1px solid #42506a;
      background: #172034;
      display: inline-grid;
      place-items: center;
      overflow: hidden;
      font-size: 10px;
      font-weight: 800;
      line-height: 1;
      color: #f7fbff;
      flex: 0 0 auto;
    }
    .chat-bubble-head-avatar img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }
    .chat-bubble-head-name {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      flex: 1 1 auto;
    }
    .chat-report-btn {
      border: 1px solid #394760;
      background: #151d2d;
      color: #ff8f8f;
      border-radius: 8px;
      height: 20px;
      min-width: 20px;
      padding: 0 5px;
      font: inherit;
      font-size: 10px;
      line-height: 1;
      font-weight: 800;
      flex: 0 0 auto;
    }
    .chat-report-btn:active {
      transform: translateY(1px);
    }
    .chat-bubble.mine .chat-bubble-head {
      color: #ffd8a7;
    }
    .chat-empty {
      margin: auto 0;
      color: #8f9db7;
      font-size: 12px;
      font-weight: 700;
      text-align: center;
      padding: 18px 10px;
    }
    .chat-bubble-reply {
      border-left: 2px solid #ff8b2f;
      background: rgba(255, 139, 47, 0.08);
      border-radius: 8px;
      padding: 5px 7px;
      margin-bottom: 6px;
    }
    .chat-bubble-reply-head {
      font-size: 10px;
      font-weight: 800;
      color: #ffbf7f;
      margin-bottom: 2px;
      line-height: 1.1;
    }
    .chat-bubble-reply-text {
      font-size: 11px;
      color: #cfd9ec;
      line-height: 1.2;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .chat-input-row {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 8px;
      align-items: center;
      padding: 10px 10px calc(24px + env(safe-area-inset-bottom, 0px));
      border-top: 1px solid #1f2633;
      background: #0b0f18;
    }
    .chat-reply-box {
      grid-column: 1 / -1;
      min-height: 38px;
      border-radius: 10px;
      border: 1px solid #5d3a23;
      background: #18120d;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 6px 8px;
    }
    .chat-reply-main {
      min-width: 0;
      flex: 1 1 auto;
    }
    .chat-reply-head {
      font-size: 10px;
      font-weight: 800;
      color: #ffc27f;
      line-height: 1.1;
    }
    .chat-reply-text {
      margin-top: 2px;
      font-size: 11px;
      font-weight: 700;
      color: #d2ddf2;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .chat-reply-cancel {
      width: 28px;
      height: 28px;
      border-radius: 9px;
      border: 1px solid #6c4629;
      background: #22140a;
      color: #ffb46d;
      font-size: 16px;
      font-weight: 800;
      line-height: 1;
      padding: 0;
      flex: 0 0 auto;
    }
    .chat-input {
      width: 100%;
      min-height: 40px;
      border-radius: 12px;
      border: 1px solid #46516a;
      background: #0f1522;
      color: #fff;
      font-family: inherit;
      font-size: 16px;
      font-weight: 700;
      line-height: 1.3;
      padding: 9px 10px;
      resize: none;
      overflow-y: hidden;
    }
    .chat-send-btn {
      min-height: 38px;
      border-radius: 12px;
      border: 0;
      background: linear-gradient(180deg, #ff6b1d 0%, #e95305 100%);
      color: #fff7ef;
      font-family: inherit;
      font-size: 12px;
      font-weight: 800;
      padding: 0 10px;
      white-space: nowrap;
    }
    .chat-send-btn:disabled {
      opacity: 0.55;
      cursor: not-allowed;
    }
    .chat-player-modal {
      position: absolute;
      inset: 0;
      z-index: 40;
      background: rgba(0, 0, 0, 0.58);
      display: grid;
      place-items: center;
      padding: 16px;
    }
    .chat-player-card {
      width: 100%;
      max-width: 360px;
      border-radius: 16px;
      border: 1px solid #2f3b55;
      background: linear-gradient(180deg, #111a2a 0%, #0b111b 100%);
      box-shadow: 0 16px 42px rgba(0, 0, 0, 0.52);
      padding: 10px;
    }
    .chat-player-head {
      display: grid;
      grid-template-columns: 72px minmax(0, 1fr);
      gap: 12px;
      align-items: center;
      padding: 10px;
      border-radius: 16px;
      border: 1px solid #2a3344;
      background: linear-gradient(180deg, #111826 0%, #0c121d 100%);
    }
    .chat-player-avatar {
      width: 72px;
      height: 72px;
      border-radius: 16px;
      border: 1px solid #394764;
      background: linear-gradient(180deg, #263553 0%, #1b2740 100%);
      display: grid;
      place-items: center;
      overflow: hidden;
      color: #f7fbff;
      font-size: 34px;
      font-weight: 800;
      flex: 0 0 auto;
    }
    .chat-player-avatar img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }
    .chat-player-name {
      color: #fff1db;
      font-size: 24px;
      font-weight: 800;
      line-height: 1.03;
      word-break: break-word;
    }
    .chat-player-level {
      margin-top: 4px;
      color: #cfdcf2;
      font-size: 13px;
      font-weight: 700;
    }
    .chat-player-meta {
      margin-top: 2px;
      color: #cfdcf2;
      font-size: 13px;
      font-weight: 700;
      line-height: 1.3;
    }
    .chat-player-stats {
      margin-top: 10px;
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }
    .chat-player-stat {
      border-radius: 10px;
      border: 1px solid #2a3852;
      background: #101a2b;
      padding: 6px 7px;
    }
    .chat-player-stat-label {
      color: #b9c9e6;
      font-size: 11px;
      font-weight: 700;
      line-height: 1.2;
    }
    .chat-player-stat-value {
      margin-top: 3px;
      color: #f6fbff;
      font-size: 13px;
      font-weight: 800;
      line-height: 1.2;
    }
    .chat-player-actions {
      margin-top: 12px;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .chat-player-btn {
      min-height: 34px;
      border-radius: 10px;
      border: 1px solid #3a4967;
      background: #1a2437;
      color: #eef4ff;
      font-family: inherit;
      font-size: 12px;
      font-weight: 800;
      padding: 0 10px;
      white-space: nowrap;
    }
    .chat-player-btn.primary {
      border: 0;
      color: #fff7f0;
      background: linear-gradient(180deg, #ff6b1d 0%, #ef4a00 100%);
    }
    #chat-player-report-btn {
      width: fit-content;
      padding: 0 12px;
      flex: 0 0 auto;
    }
    #chat-player-reply-btn {
      margin-left: auto;
      flex: 0 0 auto;
      min-width: 92px;
    }
    .rename-modal,
    .legal-modal {
      position: absolute;
      inset: 0;
      z-index: 36;
      background: rgba(0, 0, 0, 0.58);
      display: grid;
      place-items: center;
      padding: 16px;
    }
    .rename-card,
    .legal-card {
      width: 100%;
      max-width: 360px;
      border-radius: 18px;
      border: 1px solid #2f3748;
      background: linear-gradient(180deg, #111521 0%, #0b1019 100%);
      box-shadow: 0 16px 42px rgba(0, 0, 0, 0.52);
      padding: 14px 12px 12px;
    }
    .rename-title,
    .legal-title {
      font-size: 22px;
      line-height: 1.05;
      font-weight: 800;
      color: #fff3e5;
    }
    .rename-sub {
      margin-top: 8px;
      color: #d4deee;
      font-size: 13px;
      font-weight: 700;
      line-height: 1.35;
    }
    .rename-input {
      margin-top: 10px;
      width: 100%;
      min-height: 42px;
      border-radius: 12px;
      border: 1px solid #46516a;
      background: #0f1522;
      color: #fff;
      font-family: inherit;
      font-size: 15px;
      font-weight: 700;
      padding: 0 12px;
      outline: none;
    }
    .rename-actions,
    .legal-actions {
      margin-top: 12px;
      display: flex;
      justify-content: flex-end;
      gap: 8px;
    }
    .rename-btn,
    .legal-btn {
      min-height: 36px;
      border-radius: 12px;
      padding: 0 12px;
      font-size: 14px;
      font-weight: 800;
      font-family: inherit;
      border: 1px solid #4a556f;
      background: #151d2e;
      color: #f3f7ff;
    }
    .rename-btn.primary {
      border: 0;
      color: #fff7f0;
      background: linear-gradient(180deg, #ff6315 0%, #ef4400 100%);
    }
    .legal-btn.danger {
      border-color: #6f2a2a;
      background: #3c1a1a;
      color: #ffd3d3;
    }
    .legal-body {
      margin-top: 10px;
      max-height: 56vh;
      overflow: auto;
      border-radius: 12px;
      border: 1px solid #2f3a50;
      background: #0f1522;
      padding: 10px;
      white-space: pre-wrap;
      color: #d7e0f1;
      font-size: 12px;
      font-weight: 700;
      line-height: 1.4;
    }
    .profile-view {
      position: absolute;
      inset: 0;
      z-index: 28;
      background:
        linear-gradient(180deg, rgba(4, 5, 7, 0.72) 0%, rgba(4, 5, 7, 0.72) 100%),
        url("/miniapp/assets/cards/chat-bg.png"),
        #040507;
      background-position: center top;
      background-size: cover;
      background-repeat: no-repeat;
      overflow-y: auto;
      overflow-x: hidden;
      padding: 14px 10px 96px;
    }
    .profile-head {
      display: grid;
      grid-template-columns: 72px minmax(0, 1fr) auto;
      gap: 12px;
      align-items: center;
      padding: 10px;
      border-radius: 16px;
      border: 1px solid #2a3344;
      background: linear-gradient(180deg, #111826 0%, #0c121d 100%);
    }
    .profile-avatar {
      width: 72px;
      height: 72px;
      border-radius: 16px;
      border: 1px solid #394764;
      background: linear-gradient(180deg, #263553 0%, #1b2740 100%);
      display: grid;
      place-items: center;
      font-size: 34px;
      font-weight: 800;
      overflow: hidden;
      cursor: pointer;
    }
    .profile-avatar-img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }
    .profile-name {
      font-size: 24px;
      line-height: 1.03;
      font-weight: 800;
      color: #fff1db;
      word-break: break-word;
      cursor: pointer;
    }
    .profile-level {
      margin-top: 4px;
      color: #cfdcf2;
      font-size: 13px;
      font-weight: 700;
    }
    .profile-stats {
      margin-top: 2px;
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }
    .profile-stat-item {
      border-radius: 12px;
      border: 1px solid #33425e;
      padding: 7px 6px;
      text-align: center;
    }
    .profile-stat-label {
      color: #9db2d8;
      font-size: 11px;
      font-weight: 700;
      line-height: 1.2;
    }
    .profile-stat-value {
      margin-top: 4px;
      color: #eef5ff;
      font-size: 14px;
      font-weight: 800;
      line-height: 1.1;
    }
    .profile-close {
      width: 34px;
      height: 34px;
      border-radius: 11px;
      border: 1px solid #3a455e;
      background: #121a29;
      color: #f4f8ff;
      font-size: 20px;
      font-weight: 700;
      line-height: 1;
    }
    .profile-head-actions {
      display: grid;
      gap: 6px;
    }
    .profile-settings-btn {
      font-size: 16px;
    }
    .profile-card {
      margin-top: 10px;
      border-radius: 16px;
      border: 1px solid #2d384f;
      background: linear-gradient(180deg, #111928 0%, #0a1019 100%);
      padding: 12px;
    }
    .profile-card-title {
      font-size: 16px;
      font-weight: 800;
      color: #e7efff;
    }
    .profile-progress {
      margin-top: 10px;
      height: 10px;
      border-radius: 999px;
      border: 1px solid #36435e;
      background: #0d1422;
      overflow: hidden;
    }
    .profile-progress-fill {
      height: 100%;
      width: 0%;
      background: linear-gradient(90deg, #ff7d2d 0%, #ffb04a 100%);
      transition: width 180ms ease;
    }
    .profile-progress-meta {
      margin-top: 8px;
      color: #cad8f0;
      font-size: 12px;
      font-weight: 700;
    }
    .profile-vip-card {
      cursor: pointer;
      border-color: rgba(214, 174, 78, 0.42);
      background: linear-gradient(160deg, rgba(45, 38, 24, 0.92), rgba(30, 28, 20, 0.92));
    }
    .profile-vip-head {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      gap: 8px;
      margin-bottom: 8px;
    }
    .profile-vip-title {
      font-size: 15px;
      font-weight: 800;
      letter-spacing: 0.02em;
      color: #ffe09f;
    }
    .profile-vip-points {
      font-size: 12px;
      color: rgba(255, 227, 157, 0.86);
      font-weight: 700;
    }
    .profile-vip-track {
      margin-top: 10px;
    }
    .profile-vip-currency {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin-top: 10px;
    }
    .profile-actions {
      margin-top: 10px;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }
    .profile-actions.single {
      grid-template-columns: 1fr;
    }
    .profile-btn {
      min-height: 40px;
      border-radius: 12px;
      border: 1px solid #3b4a67;
      background: #151f31;
      color: #f1f6ff;
      font-family: inherit;
      font-size: 13px;
      font-weight: 800;
      padding: 0 10px;
    }
    .profile-btn.primary {
      border: 0;
      color: #fff7f0;
      background: linear-gradient(180deg, #ff6b1d 0%, #ef4a00 100%);
    }
    .profile-note {
      margin-top: 10px;
      color: #b8c8e4;
      font-size: 12px;
      font-weight: 700;
      min-height: 16px;
    }
    .profile-modal {
      position: absolute;
      inset: 0;
      z-index: 37;
      background: rgba(0, 0, 0, 0.62);
      display: grid;
      place-items: center;
      padding: 16px;
    }
    .profile-modal-card {
      width: 100%;
      max-width: 380px;
      max-height: 78vh;
      overflow: auto;
      border-radius: 18px;
      border: 1px solid #2f3b55;
      background: linear-gradient(180deg, #111a2a 0%, #0b111b 100%);
      box-shadow: 0 16px 42px rgba(0, 0, 0, 0.52);
      padding: 12px;
    }
    .profile-modal-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }
    .profile-modal-title {
      font-size: 20px;
      line-height: 1.05;
      font-weight: 800;
      color: #fff2df;
    }
    .profile-modal-close {
      width: 30px;
      height: 30px;
      border-radius: 9px;
      border: 1px solid #3d4a66;
      background: #111a2a;
      color: #edf4ff;
      font-size: 18px;
      line-height: 1;
      padding: 0;
    }
    .profile-modal-list {
      margin-top: 10px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .profile-task-row {
      border-radius: 12px;
      border: 1px solid #2f3b55;
      background: #0f1726;
      padding: 8px;
    }
    .profile-task-title {
      color: #e7efff;
      font-size: 13px;
      font-weight: 800;
    }
    .profile-task-meta {
      margin-top: 4px;
      color: #b8c8e4;
      font-size: 11px;
      font-weight: 700;
      white-space: pre-wrap;
    }
    .profile-task-btn {
      margin-top: 8px;
      min-height: 32px;
      border-radius: 10px;
      border: 1px solid #3a4967;
      background: #1a2437;
      color: #eef4ff;
      font-family: inherit;
      font-size: 12px;
      font-weight: 800;
      padding: 0 10px;
    }
    .profile-task-btn.primary {
      border: 0;
      color: #fff7f0;
      background: linear-gradient(180deg, #ff6b1d 0%, #ef4a00 100%);
    }
    .profile-week-grid {
      margin-top: 10px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .profile-week-focus {
      position: relative;
      border-radius: 14px;
      border: 1px solid #30405f;
      background: #0f1726;
      padding: 12px 10px;
      text-align: center;
    }
    .profile-week-focus.ready {
      border-color: #93531e;
      background: #24180f;
    }
    .profile-week-focus.claimed {
      border-color: #2e4f3a;
      background: #12231a;
    }
    .profile-week-day-title {
      color: #f0f5ff;
      font-size: 13px;
      font-weight: 800;
    }
    .profile-week-day-reward {
      margin-top: 6px;
      color: #c7d6ee;
      font-size: 12px;
      font-weight: 700;
      white-space: pre-wrap;
    }
    .profile-week-reward-icons {
      margin-top: 8px;
      display: flex;
      justify-content: center;
      gap: 6px;
    }
    .profile-week-check {
      position: absolute;
      top: 6px;
      right: 6px;
      min-width: 20px;
      height: 20px;
      border-radius: 999px;
      border: 1px solid #2e4f3a;
      background: #13271b;
      color: #d8ffe8;
      font-size: 12px;
      font-weight: 900;
      display: grid;
      place-items: center;
      line-height: 1;
    }
    .profile-week-strip {
      display: grid;
      grid-template-columns: repeat(7, minmax(0, 1fr));
      gap: 6px;
    }
    .profile-week-chip {
      position: relative;
      border-radius: 10px;
      border: 1px solid #30405f;
      background: #0f1726;
      padding: 6px 4px;
      min-height: 48px;
      text-align: center;
    }
    .profile-week-chip.active {
      border-color: #93531e;
      background: #24180f;
    }
    .profile-week-chip.claimed {
      border-color: #2e4f3a;
      background: #12231a;
    }
    .profile-week-chip-day {
      color: #d3def2;
      font-size: 10px;
      font-weight: 800;
      line-height: 1.1;
    }
    .profile-week-chip-reward {
      margin-top: 4px;
      color: #eff5ff;
      font-size: 13px;
      line-height: 1;
      font-weight: 800;
    }
    .profile-week-chip-check {
      position: absolute;
      top: -4px;
      right: -4px;
      width: 16px;
      height: 16px;
      border-radius: 999px;
      border: 1px solid #2e4f3a;
      background: #13271b;
      color: #d8ffe8;
      font-size: 10px;
      font-weight: 900;
      display: grid;
      place-items: center;
      line-height: 1;
    }
    .profile-week-reward-icon {
      width: 48px;
      min-height: 48px;
      border-radius: 8px;
      border: 1px solid #3a4e72;
      background: #17253d;
      display: grid;
      grid-template-rows: auto auto;
      place-items: center;
      padding: 4px 3px;
      font-weight: 800;
      color: #f0f6ff;
    }
    .profile-week-reward-icon-emoji {
      font-size: 15px;
      line-height: 1;
    }
    .profile-week-reward-icon-qty {
      margin-top: 2px;
      font-size: 10px;
      line-height: 1;
      color: #d1def4;
    }
    .avatar-modal-rules {
      margin-top: 10px;
      border-radius: 10px;
      border: 1px solid #2f3a50;
      background: #0f1522;
      padding: 8px;
      color: #d7e0f1;
      font-size: 12px;
      font-weight: 700;
      line-height: 1.35;
    }
    .avatar-modal-preview {
      margin-top: 10px;
      width: 82px;
      height: 82px;
      margin-left: auto;
      margin-right: auto;
      border-radius: 16px;
      border: 1px solid #3a4964;
      background: linear-gradient(180deg, #1d2a43 0%, #141f33 100%);
      display: grid;
      place-items: center;
      overflow: hidden;
      font-size: 36px;
      font-weight: 800;
      color: #f6f9ff;
    }
    .profile-avatar-actions {
      justify-content: center;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }
    .profile-avatar-actions .rename-btn {
      width: 100%;
    }
    .profile-avatar-crop-modal {
      position: absolute;
      inset: 0;
      z-index: 2;
      background: rgba(2, 6, 12, 0.62);
      display: grid;
      place-items: center;
      padding: 10px;
    }
    .profile-avatar-crop-card {
      width: 100%;
      max-width: 320px;
      border-radius: 14px;
      border: 1px solid #2f3a50;
      background: linear-gradient(180deg, #111a2a 0%, #0b111c 100%);
      box-shadow: 0 16px 42px rgba(0, 0, 0, 0.52);
      padding: 10px;
    }
    .profile-avatar-crop-title {
      font-size: 16px;
      line-height: 1.1;
      font-weight: 800;
      color: #fff2df;
      text-align: center;
    }
    .profile-avatar-crop-sub {
      margin-top: 4px;
      text-align: center;
      color: #c7d4eb;
      font-size: 11px;
      font-weight: 700;
    }
    .profile-avatar-crop-viewport {
      margin: 8px auto 0;
      width: 260px;
      height: 260px;
      border-radius: 12px;
      border: 1px solid #3a4964;
      background: #0d1423;
      position: relative;
      overflow: hidden;
      touch-action: none;
      user-select: none;
    }
    .profile-avatar-crop-image {
      position: absolute;
      left: 50%;
      top: 50%;
      transform-origin: center center;
      will-change: transform;
      pointer-events: none;
    }
    .profile-avatar-crop-cutout {
      position: absolute;
      left: 50%;
      top: 50%;
      width: 180px;
      height: 180px;
      transform: translate(-50%, -50%);
      border: 1px solid rgba(255, 255, 255, 0.86);
      box-shadow: 0 0 0 999px rgba(3, 7, 13, 0.62);
      border-radius: 8px;
      pointer-events: none;
      overflow: hidden;
    }
    .profile-avatar-crop-grid {
      position: absolute;
      inset: 0;
      pointer-events: none;
      background-image:
        linear-gradient(to right, rgba(255,255,255,0.12) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.12) 1px, transparent 1px);
      background-size: calc(100% / 3) 100%, 100% calc(100% / 3);
    }
    .profile-avatar-crop-zoom {
      margin-top: 8px;
      width: 100%;
    }
    .profile-avatar-crop-actions {
      margin-top: 10px;
      display: flex;
      justify-content: space-between;
      gap: 8px;
    }
    .profile-avatar-crop-btn {
      min-height: 34px;
      border-radius: 10px;
      border: 1px solid #415171;
      background: #161f32;
      color: #edf4ff;
      font-family: inherit;
      font-size: 13px;
      font-weight: 800;
      padding: 0 14px;
      flex: 1 1 0;
    }
    .profile-avatar-crop-btn.primary {
      border: 0;
      color: #fff7f0;
      background: linear-gradient(180deg, #ff6b1d 0%, #ef4a00 100%);
    }
    .clan-view {
      position: absolute;
      inset: 0;
      z-index: 27;
      background: #000;
      border-radius: 24px;
      overflow-y: auto;
      overflow-x: hidden;
      display: flex;
      flex-direction: column;
    }
    .clan-hero {
      min-height: 352px;
      padding: 12px 10px 14px;
      background:
        linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.82) 76%, #000 100%),
        var(--miniapp-clan-bg, url('/miniapp/assets/cards/screen-clan.png')),
        linear-gradient(135deg, #3d2a1f 0%, #1b1f29 58%, #141820 100%);
      border-bottom: 1px solid #1e2430;
      background-position: center -10px;
      background-size: 118%;
      background-repeat: no-repeat;
    }
    .clan-close {
      width: 34px;
      height: 34px;
      border-radius: 12px;
      border: 1px solid #313640;
      background: rgba(10, 10, 12, 0.45);
      color: #f8fbff;
      font-size: 21px;
      line-height: 1;
      display: grid;
      place-items: center;
      font-family: inherit;
      margin-top: 8px;
    }
    .clan-title {
      margin: 182px 0 0;
      font-size: clamp(25px, 8vw, 42px);
      line-height: 0.98;
      font-weight: 800;
      letter-spacing: -0.02em;
    }
    .clan-sub {
      margin: 8px 0 0;
      color: #ffb75d;
      font-weight: 700;
      font-size: 16px;
    }
    .clan-list {
      padding: 10px;
      padding-bottom: 96px;
      display: flex;
      flex-direction: column;
      gap: 12px;
      min-height: 0;
      flex: 1 0 auto;
      overflow: visible;
    }
    .clan-card {
      border: 1px solid #8b430f;
      border-radius: 22px;
      padding: 12px;
      background: #07090f;
    }
    .clan-card.muted {
      border-color: #2f3a50;
      background: #0f1522;
    }
    .clan-card-title {
      font-size: 20px;
      line-height: 1.05;
      font-weight: 800;
    }
    .clan-meta {
      margin-top: 6px;
      color: #9fb0c8;
      font-size: 12px;
      font-weight: 700;
      line-height: 1.35;
      white-space: pre-line;
    }
    #clan-welcome-card {
      min-height: 112px;
      display: flex;
      flex-direction: column;
    }
    #clan-welcome-meta {
      white-space: pre-wrap;
      overflow-wrap: anywhere;
      word-break: break-word;
      flex: 1 1 auto;
    }
    .clan-actions {
      margin-top: 10px;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }
    .clan-btn {
      min-height: 38px;
      border-radius: 12px;
      border: 1px solid #8b430f;
      background: #0f131d;
      color: #fff;
      font-family: inherit;
      font-size: 13px;
      font-weight: 800;
      padding: 0 10px;
    }
    .clan-btn.primary {
      border: 0;
      background: linear-gradient(180deg, #ff6b1d 0%, #e95305 100%);
      color: #fff6ec;
    }
    .clan-btn:disabled {
      border-color: #3a4456;
      background: #202734;
      color: #95a2b8;
      opacity: 0.95;
      filter: grayscale(0.2);
      cursor: not-allowed;
    }
    .clan-input {
      width: 100%;
      min-height: 40px;
      margin-top: 8px;
      border-radius: 12px;
      border: 1px solid #46516a;
      background: #0f1522;
      color: #fff;
      font-family: inherit;
      font-size: 14px;
      font-weight: 700;
      padding: 0 10px;
    }
    .clan-input-label {
      margin-top: 8px;
      color: #cfd7e8;
      font-size: 12px;
      font-weight: 800;
      line-height: 1.2;
    }
    .clan-textarea {
      min-height: 92px;
      padding: 10px;
      resize: none;
      overflow-y: auto;
      overflow-x: hidden;
    }
    .clan-textarea::-webkit-resizer {
      display: none;
    }
    .clan-members, .clan-logs, .clan-top-list {
      margin-top: 8px;
      display: flex;
      flex-direction: column;
      gap: 7px;
    }
    .clan-row {
      border: 1px solid #2f3a50;
      border-radius: 12px;
      background: #101622;
      padding: 8px 10px;
      color: #d9e3f4;
      font-size: 12px;
      font-weight: 700;
      line-height: 1.3;
      white-space: pre-line;
    }
    .clan-note {
      margin: 2px 12px 6px;
      color: #9ca6b8;
      font-size: 12px;
      font-weight: 700;
      min-height: 16px;
      flex: 0 0 auto;
    }
    .clan-section-title {
      margin: 0 0 8px;
      font-size: 20px;
      line-height: 1.05;
      font-weight: 800;
    }
    .clan-group-title {
      margin: 8px 0 2px;
      color: #ffbf74;
      font-size: 12px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    .clan-bottom-nav {
      position: sticky;
      bottom: 0;
      z-index: 6;
      margin-top: auto;
      flex: 0 0 auto;
      padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
      border-top: 1px solid #1f2633;
      background: linear-gradient(180deg, rgba(4, 5, 8, 0.75) 0%, rgba(4, 5, 8, 0.98) 52%, rgba(4, 5, 8, 1) 100%);
      backdrop-filter: blur(6px);
    }
    .clan-tabs {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }
    .clan-tab-btn {
      min-height: 42px;
      border-radius: 12px;
      border: 1px solid #344058;
      background: #101727;
      color: #e8eefc;
      font-family: inherit;
      font-size: 11px;
      font-weight: 800;
      line-height: 1.1;
      padding: 4px 4px 5px;
      display: grid;
      place-items: center;
      text-align: center;
    }
    .clan-tab-btn.active {
      border-color: #8b430f;
      background: linear-gradient(180deg, #ff6b1d 0%, #e95305 100%);
      color: #fff7ef;
    }
    .clan-mini-actions {
      margin-top: 8px;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 6px;
    }
    .clan-mini-btn {
      min-height: 32px;
      border-radius: 10px;
      border: 1px solid #8b430f;
      background: #121825;
      color: #fff;
      font-family: inherit;
      font-size: 11px;
      font-weight: 800;
      padding: 0 8px;
    }
    .clan-mini-btn.warn {
      border-color: #6f2332;
      background: #25121a;
      color: #ffd9de;
    }
    .clan-browse-pager {
      margin-top: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
    }
    .clan-browse-arrow {
      width: 34px;
      height: 34px;
      border-radius: 10px;
      border: 1px solid #3a4862;
      background: #172132;
      color: #eef4ff;
      font-family: inherit;
      font-size: 18px;
      font-weight: 800;
      line-height: 1;
      padding: 0;
    }
    .clan-browse-page {
      color: #cfd7e8;
      font-size: 12px;
      font-weight: 800;
      min-width: 74px;
      text-align: center;
    }
    .clan-actions.vertical {
      grid-template-columns: 1fr;
    }
    .clan-quick-grid {
      margin-top: 0;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }
    .clan-quick-btn {
      min-height: 46px;
      border-radius: 12px;
      border: 1px solid #2f4e81;
      background: linear-gradient(180deg, #1c2f4f 0%, #16253d 100%);
      color: #eef5ff;
      font-family: inherit;
      font-size: 12px;
      font-weight: 800;
      line-height: 1.1;
      padding: 4px 4px 5px;
      text-align: center;
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 4px 12px rgba(8, 15, 28, 0.32);
    }
    .clan-quick-btn.active {
      border-color: #ff9753;
      background: linear-gradient(180deg, #ff7f35 0%, #e85a1d 100%);
      color: #fff8ef;
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 6px 16px rgba(81, 28, 5, 0.38);
    }
    #clan-quick-card {
      border: 0;
      background: transparent;
      padding: 0;
    }
    .clan-member-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }
    .clan-member-menu-btn {
      width: 30px;
      height: 30px;
      border-radius: 10px;
      border: 1px solid #3a4862;
      background: #172132;
      color: #eef4ff;
      font-family: inherit;
      font-size: 16px;
      font-weight: 800;
      line-height: 1;
      padding: 0;
      display: grid;
      place-items: center;
    }

    .clan-invite-modal {
      position: absolute;
      inset: 0;
      z-index: 36;
      background: rgba(0, 0, 0, 0.58);
      display: grid;
      place-items: center;
      padding: 16px;
    }
    .clan-invite-card {
      width: 100%;
      max-width: 340px;
      border-radius: 18px;
      border: 1px solid #2f3748;
      background: linear-gradient(180deg, #111521 0%, #0b1019 100%);
      box-shadow: 0 16px 42px rgba(0, 0, 0, 0.52);
      padding: 14px 12px 12px;
    }
    .clan-invite-title { font-size: 22px; line-height: 1; font-weight: 800; color: #fff3e5; }
    .clan-invite-code {
      margin-top: 10px;
      border: 1px solid #2f3a50;
      border-radius: 12px;
      background: #0f1522;
      color: #ffbd74;
      font-size: 20px;
      font-weight: 800;
      text-align: center;
      letter-spacing: 0.06em;
      padding: 10px;
      word-break: break-all;
    }
    .clan-invite-actions {
      margin-top: 12px;
      display: flex;
      justify-content: flex-end;
      gap: 8px;
    }

    .raids-view {
      position: absolute;
      inset: 0;
      z-index: 27;
      background: #000;
      border-radius: 24px;
      overflow-y: auto;
    }

    .raids-hero {
      min-height: 360px;
      padding: 12px 10px 18px;
      background:
        linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.82) 76%, #000 100%),
        var(--miniapp-raids-hero, url('/miniapp/assets/cards/screen-raids.png')),
        linear-gradient(135deg, #3f2f1d 0%, #1f1815 55%, #121314 100%);
      background-position: center -10px;
      background-size: 118%;
      background-repeat: no-repeat;
      border-bottom: 1px solid #1e2430;
      position: relative;
    }

    .raids-close {
      width: 34px;
      height: 34px;
      border-radius: 12px;
      border: 1px solid #313640;
      background: rgba(10, 10, 12, 0.45);
      color: #f8fbff;
      font-size: 21px;
      line-height: 1;
      display: grid;
      place-items: center;
      font-family: inherit;
      margin-top: 10px;
    }

    .raids-title {
      margin: 182px 0 0;
      font-size: clamp(25px, 8vw, 42px);
      line-height: 0.98;
      font-weight: 800;
      letter-spacing: -0.02em;
    }
    .raids-sub {
      margin: 8px 0 0;
      color: #ffb75d;
      font-weight: 700;
      font-size: 17px;
    }

    .raids-list {
      padding: 12px 10px 16px;
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    #ratings-view .raids-hero {
      min-height: 312px;
      padding-bottom: 10px;
      background:
        linear-gradient(180deg, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0.66) 58%, rgba(0,0,0,0.93) 84%, #000 100%),
        var(--miniapp-ratings-hero, url('/miniapp/assets/cards/screen-ratings.png')),
        linear-gradient(135deg, #2f261f 0%, #1a1e27 55%, #121418 100%);
      background-position: center -10px;
      background-size: 118%;
      background-repeat: no-repeat;
    }
    #ratings-view .raids-list {
      padding-top: 8px;
    }

    .raid-mode-btn {
      min-height: 138px;
      border-radius: 24px;
      border: 2px solid rgba(255,255,255,0.22);
      padding: 16px 16px;
      color: #fff;
      font-family: inherit;
      text-align: left;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    #ratings-menu .raid-mode-btn {
      min-height: 96px;
      border-radius: 16px;
      border-width: 1px;
      padding: 10px 12px;
    }
    #ratings-menu .raid-mode-title { font-size: 18px; }
    #ratings-menu .raid-mode-sub { margin-top: 5px; font-size: 11px; color: #dbe6fb; }
    #ratings-menu .raid-arrow { font-size: 28px; color: #dbe6fb; }
    #ratings-open-pvp {
      border-color: #745b4c;
      background: linear-gradient(180deg, #3b2a23 0%, #2b1f19 100%);
    }
    #ratings-open-pve {
      border-color: #476556;
      background: linear-gradient(180deg, #1f3a2d 0%, #152a21 100%);
    }
    #ratings-open-tribe {
      border-color: #4d5f78;
      background: linear-gradient(180deg, #223349 0%, #172535 100%);
    }
    #ratings-open-clans {
      border-color: #6a604f;
      background: linear-gradient(180deg, #3a3023 0%, #2b241a 100%);
    }
    #ratings-view #ratings-menu .raid-mode-btn {
      border-color: #2b313f;
      background: #000;
    }
    #ratings-view .raid-target-item {
      border-color: #2b313f;
      background: #000;
    }

    .raid-mode-btn.pve {
      border-color: #8a3f14;
      background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.34) 0%, rgba(0, 0, 0, 0.58) 100%),
        linear-gradient(145deg, #141923 0%, #1f2d43 52%, #273953 100%);
    }

    .raid-mode-btn.pvp {
      border-color: #8a3f14;
      background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.34) 0%, rgba(0, 0, 0, 0.58) 100%),
        linear-gradient(145deg, #141923 0%, #1f2d43 52%, #273953 100%);
    }

    .raid-mode-title {
      font-size: 24px;
      line-height: 1;
      font-weight: 800;
    }

    .raid-mode-sub {
      margin-top: 8px;
      font-size: 12px;
      font-weight: 700;
      color: #eef8ff;
    }

    .raid-mode-meta {
      margin-top: 8px;
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }

    .raid-chip {
      min-height: 24px;
      border-radius: 999px;
      border: 1px solid rgba(255, 255, 255, 0.34);
      background: rgba(0, 0, 0, 0.2);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0 8px;
      font-size: 11px;
      font-weight: 800;
      line-height: 1;
      color: #f8fbff;
      white-space: nowrap;
    }

    .raid-mode-side {
      display: flex;
      align-items: center;
      gap: 8px;
      flex: 0 0 auto;
      font-weight: 800;
    }

    .raid-rating {
      text-align: right;
      line-height: 1.02;
    }

    .raid-rating-val {
      font-size: 30px;
      font-weight: 800;
      line-height: 1;
    }

    .raid-rating-label {
      margin-top: 3px;
      font-size: 13px;
      color: #ffe4de;
    }

    .raid-arrow {
      font-size: 38px;
      line-height: 1;
      color: #fff5ee;
    }

    .raids-targets {
      margin: 4px 10px 0;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .boost-btn.raids-back-btn {
      position: sticky;
      top: 8px;
      right: auto;
      bottom: auto;
      align-self: flex-start;
      min-height: 36px;
      min-width: 0;
      border-radius: 12px;
      font-size: 14px;
      padding: 0 12px;
      margin: 0 0 8px;
      z-index: 9;
    }

    .raid-target-item {
      border: 1px solid #2f3748;
      border-radius: 16px;
      background: #0f141f;
      padding: 10px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .raid-target-main {
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .raid-target-name {
      font-size: 15px;
      font-weight: 800;
      line-height: 1.05;
      color: #f5f7fd;
    }

    .raid-target-meta {
      font-size: 12px;
      font-weight: 700;
      color: #b6bfd0;
      line-height: 1.2;
    }

    .raid-target-btn {
      min-height: 34px;
      min-width: 88px;
      border: 0;
      border-radius: 12px;
      background: linear-gradient(180deg, #ff6315 0%, #ef4400 100%);
      color: #fff7f0;
      font-family: inherit;
      font-size: 13px;
      font-weight: 800;
      padding: 0 10px;
      white-space: nowrap;
    }

    .raid-target-btn:disabled {
      opacity: 0.55;
      filter: grayscale(0.3);
    }
    .raid-target-item.self {
      border-color: #8a3f14;
      background: #101722;
    }
    .raid-target-tag {
      margin-left: 6px;
      color: #ffbf74;
      font-weight: 800;
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .raids-note {
      margin: 8px 12px 0;
      color: #9ca6b8;
      font-size: 12px;
      font-weight: 700;
      text-align: center;
      line-height: 1.3;
    }

    .evolution-view {
      position: absolute;
      inset: 0;
      z-index: 28;
      background: #000;
      border-radius: 24px;
      overflow-y: auto;
    }

    .evolution-hero {
      min-height: 360px;
      padding: 12px 10px 16px;
      background:
        linear-gradient(180deg, rgba(0,0,0,0.14) 0%, rgba(0,0,0,0.72) 76%, #000 100%),
        var(--miniapp-card-evolution, url('/miniapp/assets/cards/screen-evolution.png')),
        radial-gradient(420px 230px at 82% 100%, rgba(74, 120, 184, 0.30), transparent 68%),
        linear-gradient(145deg, #141923 0%, #1f2d43 52%, #273953 100%);
      border-bottom: 1px solid #2a3342;
      background-position: center -10px;
      background-size: 118%;
      background-repeat: no-repeat;
    }

    .evolution-close {
      width: 34px;
      height: 34px;
      border-radius: 12px;
      border: 1px solid #6c3a1a;
      background: rgba(10, 10, 12, 0.40);
      color: #f8fbff;
      font-size: 21px;
      line-height: 1;
      display: grid;
      place-items: center;
      font-family: inherit;
      margin-top: 10px;
    }

    .evolution-hero-content {
      margin-top: 182px;
      text-align: left;
    }

    .evolution-title {
      margin: 0;
      font-size: clamp(25px, 8vw, 42px);
      line-height: 0.98;
      font-weight: 800;
      letter-spacing: -0.02em;
    }

    .evolution-sub {
      margin: 8px 0 0;
      color: #ffd3a3;
      font-weight: 700;
      font-size: 16px;
    }

    .evolution-status {
      margin-top: 14px;
      border: 1px solid #7a3a13;
      border-radius: 18px;
      padding: 12px 14px;
      background: rgba(35, 15, 7, 0.68);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .evolution-status-main { min-width: 0; }
    .evolution-status-label {
      font-size: 12px;
      color: #d9b08c;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    .evolution-status-value {
      margin-top: 3px;
      font-size: 20px;
      line-height: 1.06;
      font-weight: 800;
      color: #f4f9ff;
    }

    .evolution-speedup-btn {
      min-width: 128px;
      min-height: 40px;
      border: 0;
      border-radius: 14px;
      padding: 0 12px;
      font-size: 14px;
      line-height: 1;
      font-weight: 800;
      font-family: inherit;
      color: #fff6ec;
      background: linear-gradient(180deg, #ff7a22 0%, #f25706 100%);
      flex: 0 0 auto;
    }

    .evolution-speedup-btn:disabled {
      opacity: 0.45;
      filter: grayscale(0.2);
    }

    .evolution-list {
      padding: 12px 10px 16px;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .evolution-item {
      min-height: 150px;
      border: 1px solid #8a3f14;
      border-radius: 24px;
      padding: 12px 12px 58px 78px;
      background: rgba(0, 0, 0, 0.22);
      position: relative;
    }

    .evolution-item-icon {
      position: absolute;
      top: 12px;
      left: 12px;
      width: 52px;
      height: 52px;
      border-radius: 14px;
      background: linear-gradient(180deg, #ff7a22 0%, #e64f02 100%);
      display: grid;
      place-items: center;
      border: 1px solid #a94811;
    }
    .evolution-item-icon img {
      width: 28px;
      height: 28px;
      display: block;
    }

    .evolution-item-main { min-width: 0; }

    .evolution-item-name {
      font-size: clamp(20px, 5.5vw, 23px);
      line-height: 1;
      font-weight: 800;
    }

    .evolution-item-desc {
      margin-top: 3px;
      color: #a8bad6;
      font-size: 12px;
      font-weight: 700;
    }
    .evolution-item-level {
      margin-top: 4px;
      font-size: 13px;
      font-weight: 700;
      color: #ffa541;
    }
    .evolution-item-timer {
      margin-top: 3px;
      font-size: 12px;
      color: #8eb4ff;
      font-weight: 700;
    }

    .evolution-item-effects {
      margin-top: 4px;
      color: #c4d1e4;
      font-size: 11px;
      font-weight: 700;
      line-height: 1.22;
      white-space: pre-line;
    }

    .evolution-item-meta {
      margin-top: 4px;
      color: #d7e5fa;
      font-size: 13px;
      font-weight: 800;
    }
    .evolution-item-cost {
      margin-top: 4px;
      color: #9ca8bb;
      font-size: 12px;
      font-weight: 700;
      line-height: 1.3;
    }

    .evolution-start-btn {
      position: absolute;
      right: 12px;
      bottom: 12px;
      min-width: 112px;
      min-height: 40px;
      border: 0;
      border-radius: 14px;
      padding: 0 10px;
      font-size: 14px;
      line-height: 1;
      font-weight: 800;
      font-family: inherit;
      color: #fff6ec;
      background: linear-gradient(180deg, #ff6f1f 0%, #eb5004 100%);
      z-index: 2;
    }
    .evolution-start-btn.is-cooldown {
      min-width: 120px;
      font-size: 12px;
      letter-spacing: 0.01em;
    }
    .evolution-start-btn .timer {
      font-size: 12px;
      line-height: 1;
      white-space: nowrap;
    }

    .evolution-start-btn:disabled {
      opacity: 0.46;
      filter: grayscale(0.2);
    }

    .evolution-note {
      margin: 2px 12px 0;
      color: #8c95a7;
      font-size: 12px;
      font-weight: 700;
      text-align: center;
    }

    .shop-view {
      position: absolute;
      inset: 0;
      z-index: 29;
      background: #000;
      border-radius: 24px;
      overflow-y: auto;
    }

    .shop-hero {
      min-height: 330px;
      padding: 12px 10px 16px;
      background:
        linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.82) 76%, #000 100%),
        var(--miniapp-shop-bg, url('/miniapp/assets/cards/screen-shop.png')),
        radial-gradient(460px 260px at 80% 100%, rgba(84, 102, 168, 0.34), transparent 72%),
        linear-gradient(145deg, #2c1a12 0%, #3a2418 42%, #25273a 100%);
      border-bottom: 1px solid #2d3347;
      background-position: center -10px;
      background-size: 118%;
      background-repeat: no-repeat;
    }

    .shop-close {
      width: 34px;
      height: 34px;
      border-radius: 12px;
      border: 1px solid #603c2e;
      background: rgba(10, 10, 12, 0.40);
      color: #f8fbff;
      font-size: 21px;
      line-height: 1;
      display: grid;
      place-items: center;
      font-family: inherit;
      margin-top: 10px;
    }

    .shop-hero-content {
      margin-top: 182px;
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
    }

    .shop-gem {
      width: 56px;
      height: 56px;
      display: grid;
      place-items: center;
      filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.32));
    }

    .shop-title {
      margin: 12px 0 0;
      font-size: clamp(25px, 8vw, 42px);
      line-height: 0.98;
      font-weight: 800;
      letter-spacing: -0.02em;
    }

    .shop-sub {
      margin: 8px 0 0;
      color: #dfd6c7;
      font-weight: 700;
      font-size: 17px;
    }

    /* Stronger bottom fade for these three hero assets to match buildings-style transition. */
    .raids-hero::after,
    .evolution-hero::after,
    .shop-hero::after {
      height: min(58%, 240px);
      background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.74) 48%, rgba(0, 0, 0, 0.92) 78%, #000 100%);
    }

    .shop-list {
      padding: 12px 10px 16px;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .shop-item {
      min-height: 94px;
      border: 1px solid #3a445c;
      border-radius: 24px;
      padding: 12px;
      background: #0b1019;
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .shop-item-icon {
      width: 50px;
      height: 50px;
      border-radius: 14px;
      background: linear-gradient(180deg, #b67834 0%, #80502a 100%);
      display: grid;
      place-items: center;
      font-size: 25px;
      flex: 0 0 auto;
    }

    .shop-item-main {
      flex: 1;
      min-width: 0;
    }

    .shop-item-name {
      font-size: 24px;
      line-height: 1;
      font-weight: 800;
    }

    .shop-item-price {
      margin-top: 4px;
      color: #caa67b;
      font-size: 13px;
      font-weight: 800;
    }

    .shop-buy-btn {
      min-width: 94px;
      min-height: 42px;
      border: 0;
      border-radius: 16px;
      padding: 0 12px;
      font-size: 19px;
      line-height: 1;
      font-weight: 800;
      font-family: inherit;
      background: linear-gradient(180deg, #d98a3f 0%, #b86c2c 100%);
      color: #fff3e4;
      flex: 0 0 auto;
    }

    .shop-buy-btn:disabled {
      opacity: 0.55;
      filter: grayscale(0.2);
    }

    .shop-note {
      margin: 2px 12px 0;
      color: #8c95a7;
      font-size: 12px;
      font-weight: 700;
      text-align: center;
    }

    .amber-open-btn {
      margin-top: 10px;
      min-height: 42px;
      border: 0;
      border-radius: 16px;
      padding: 0 16px;
      font-size: 15px;
      font-weight: 800;
      font-family: inherit;
      color: #fff3e4;
      background: linear-gradient(180deg, #d78a41 0%, #b86b2f 100%);
      box-shadow: 0 8px 18px rgba(113, 71, 32, 0.28);
    }

    .amber-view {
      position: absolute;
      inset: 0;
      z-index: 30;
      background: #000;
      border-radius: 24px;
      overflow-y: auto;
    }

    .amber-hero {
      min-height: 300px;
      padding: 12px 10px 16px;
      background:
        linear-gradient(180deg, rgba(0,0,0,0.14) 0%, rgba(0,0,0,0.70) 76%, #000 100%),
        var(--miniapp-amber-bg, url('/miniapp/assets/cards/screen-amber.png')),
        radial-gradient(460px 260px at 80% 100%, rgba(84, 102, 168, 0.34), transparent 72%),
        linear-gradient(145deg, #2c1a12 0%, #3a2418 42%, #25273a 100%);
      border-bottom: 1px solid #2d3347;
      background-position: center -10px;
      background-size: 118%;
      background-repeat: no-repeat;
    }

    .amber-close {
      width: 34px;
      height: 34px;
      border-radius: 12px;
      border: 1px solid #603c2e;
      background: rgba(10, 10, 12, 0.40);
      color: #f8fbff;
      font-size: 21px;
      line-height: 1;
      display: grid;
      place-items: center;
      font-family: inherit;
      margin-top: 10px;
    }

    .amber-hero-content {
      margin-top: 182px;
      text-align: center;
    }

    .amber-title {
      margin: 0;
      font-size: clamp(25px, 8vw, 42px);
      line-height: 0.98;
      font-weight: 800;
      letter-spacing: -0.02em;
    }

    .amber-sub {
      margin: 8px 0 0;
      color: #dfd6c7;
      font-weight: 700;
      font-size: 17px;
    }

    .amber-list {
      padding: 12px 10px 16px;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .amber-item {
      min-height: 94px;
      border: 1px solid #3a445c;
      border-radius: 24px;
      padding: 12px;
      background: #0b1019;
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .amber-item-icon {
      width: 50px;
      height: 50px;
      border-radius: 14px;
      background: linear-gradient(180deg, #b67834 0%, #80502a 100%);
      display: grid;
      place-items: center;
      font-size: 25px;
      flex: 0 0 auto;
    }

    .amber-item-main {
      flex: 1;
      min-width: 0;
    }

    .amber-item-name {
      font-size: 24px;
      line-height: 1;
      font-weight: 800;
    }

    .amber-item-price {
      margin-top: 4px;
      color: #caa67b;
      font-size: 13px;
      font-weight: 800;
    }

    .amber-buy-btn {
      min-width: 94px;
      min-height: 42px;
      border: 0;
      border-radius: 16px;
      padding: 0 12px;
      font-size: 19px;
      line-height: 1;
      font-weight: 800;
      font-family: inherit;
      background: linear-gradient(180deg, #d98a3f 0%, #b86c2c 100%);
      color: #fff3e4;
      flex: 0 0 auto;
    }

    .amber-note {
      margin: 2px 12px 0;
      color: #8c95a7;
      font-size: 12px;
      font-weight: 700;
      text-align: center;
    }

    @media (max-width: 430px) {
      .screen { padding-left: 8px; padding-right: 8px; }
      .resources { gap: 6px; }
      .res {
        min-height: 36px;
        border-radius: 12px;
        gap: 4px;
        font-size: 13px;
      }
      .res span:last-child { font-size: clamp(15px, 4.8vw, 18px); }
      .buildings-title { margin-top: 182px; font-size: clamp(34px, 9.2vw, 41px); }
      .building-title { font-size: clamp(18px, 5.4vw, 20px); }
      .building-item {
        min-height: 144px;
        border-radius: 20px;
        padding: 10px 10px 56px 72px;
      }
      .building-icon { top: 10px; left: 10px; width: 48px; height: 48px; font-size: 23px; border-radius: 14px; }
      .building-content { min-width: 0; }
      .building-desc { font-size: 13px; line-height: 1.3; }
      .building-cost { font-size: 12px; line-height: 1.3; }
      .boost-btn {
        right: 10px;
        bottom: 10px;
        font-size: 16px;
        border-radius: 14px;
      }
      .evolution-item {
        min-height: 148px;
        border-radius: 20px;
        padding: 10px 10px 56px 72px;
      }
      .evolution-item-icon { top: 10px; left: 10px; width: 48px; height: 48px; font-size: 22px; border-radius: 12px; }
      .evolution-start-btn { right: 10px; bottom: 10px; min-width: 98px; min-height: 36px; font-size: 13px; border-radius: 12px; }
    }

    @media (max-width: 380px) {
      .screen {
        padding: calc(10px + env(safe-area-inset-top, 0px)) 8px calc(10px + env(safe-area-inset-bottom, 0px));
      }
      .resources { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
      .res { min-height: 34px; border-radius: 11px; gap: 3px; font-size: 12px; }
      .res span:last-child { font-size: clamp(14px, 4.6vw, 16px); }
      .buildings-title { margin-top: 146px; font-size: 41px; }
      .building-item { min-height: 136px; border-radius: 20px; padding: 10px 10px 52px 70px; }
      .building-icon { top: 10px; left: 10px; width: 48px; height: 48px; font-size: 23px; border-radius: 14px; }
      .building-title { font-size: 20px; }
      .boost-btn { right: 10px; bottom: 10px; min-width: 82px; font-size: 15px; border-radius: 14px; }
      .warriors-title { margin-top: 146px; font-size: clamp(22px, 7.2vw, 32px); }
      .squad-label { font-size: 15px; }
      .squad-count { font-size: 36px; }
      .squad-shield { width: 58px; height: 58px; font-size: 28px; }
      .squad-stats { grid-template-columns: 1fr 1fr 1fr; }
      .sstat { min-height: 66px; }
      .sstat-val { font-size: 26px; }
      .sstat-label { font-size: 12px; }
      .warrior-item { min-height: 90px; border-radius: 20px; padding: 10px; }
      .warrior-icon { width: 48px; height: 48px; font-size: 23px; border-radius: 14px; }
      .warrior-name { font-size: 21px; }
      .warrior-meta { font-size: 12px; }
      .scout-btn { min-height: 76px; border-radius: 18px; }
      .scout-title { font-size: 21px; }
      .scout-sub { font-size: 12px; }
      .scout-icon { width: 52px; height: 52px; font-size: 26px; }
      .raids-title { margin-top: 146px; font-size: clamp(22px, 7.2vw, 32px); }
      .raids-hero { min-height: 328px; }
      .raid-mode-btn { min-height: 122px; border-radius: 20px; }
      .raid-mode-title { font-size: 21px; }
      .raid-rating-val { font-size: 26px; }
      .raid-arrow { font-size: 34px; }
      .evolution-hero { min-height: 328px; }
      .evolution-hero-content { margin-top: 146px; }
      .evolution-title { font-size: clamp(22px, 7.2vw, 32px); }
      .evolution-status-value { font-size: 18px; }
      .evolution-speedup-btn { min-width: 114px; min-height: 38px; font-size: 13px; border-radius: 13px; }
      .evolution-item { min-height: 138px; border-radius: 20px; padding: 10px 10px 52px 70px; }
      .evolution-item-icon { top: 10px; left: 10px; width: 48px; height: 48px; font-size: 22px; border-radius: 12px; }
      .evolution-item-name { font-size: 20px; }
      .evolution-item-effects { font-size: 10px; }
      .evolution-start-btn { right: 10px; bottom: 10px; min-width: 98px; min-height: 36px; font-size: 13px; border-radius: 12px; }
      .shop-hero { min-height: 304px; }
      .shop-hero-content { margin-top: 146px; }
      .shop-gem { width: 50px; height: 50px; }
      .shop-item { min-height: 88px; border-radius: 20px; }
      .shop-item-name { font-size: 21px; }
      .shop-buy-btn { min-width: 84px; min-height: 38px; font-size: 15px; border-radius: 14px; }
      .amber-hero { min-height: 282px; }
      .amber-hero-content { margin-top: 146px; }
      .amber-item { min-height: 88px; border-radius: 20px; }
      .amber-item-name { font-size: 21px; }
      .amber-buy-btn { min-width: 84px; min-height: 38px; font-size: 15px; border-radius: 14px; }
      .tabs { gap: 3px; }
      .tab { min-height: 54px; padding: 3px 1px; font-size: 10px; }
      .tab .i { font-size: 17px; }
    }

    @media (max-width: 360px) {
      .tab {
        min-height: 48px;
        padding: 2px;
      }
      .tab span:last-child {
        display: none;
      }
      .tab .i {
        font-size: 20px;
      }
    }

    @media (max-width: 340px) {
      .resources { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
      .res { min-height: 34px; }
    }

    @media (min-width: 700px) {
      body {
        align-items: center;
        min-height: 100dvh;
      }
      .screen {
        max-width: 520px;
        min-height: min(900px, calc(100dvh - 24px));
        border-radius: 28px;
        padding-left: 14px;
        padding-right: 14px;
      }
      .resources { gap: 10px; }
      .res { min-height: 42px; }
      .res span:last-child { font-size: 20px; }
    }
  
