﻿:root {
      --bg: #0d1321;
      --bg-soft: #151d30;
      --panel: rgba(13, 19, 33, 0.84);
      --line: rgba(193, 214, 255, 0.16);
      --text: #eef4ff;
      --muted: #aab7d5;
      --accent: #7be0b8;
      --accent-2: #ff9e6d;
      --danger: #ff6f7f;
      --gold: #f7d774;
      --tile: rgba(255, 255, 255, 0.04);
      --tile-hot: rgba(123, 224, 184, 0.24);
      --tile-enemy: rgba(255, 111, 127, 0.2);
      --shadow: 0 16px 60px rgba(0, 0, 0, 0.35);
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      min-height: 100vh;
      font-family: "Segoe UI Variable Display", "Microsoft YaHei UI", sans-serif;
      color: var(--text);
      background:
        radial-gradient(circle at top left, rgba(123, 224, 184, 0.14), transparent 28%),
        radial-gradient(circle at top right, rgba(247, 215, 116, 0.12), transparent 26%),
        linear-gradient(180deg, #11192c 0%, #090d18 100%);
    }

    body::before {
      content: "";
      position: fixed;
      inset: 0;
      background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
      background-size: 24px 24px;
      mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent);
      pointer-events: none;
    }

    .app {
      display: grid;
      grid-template-columns: 320px minmax(0, 1fr) 360px;
      gap: 18px;
      padding: 18px;
    }

    .panel {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 22px;
      box-shadow: var(--shadow);
      backdrop-filter: blur(16px);
    }

    .side {
      padding: 18px;
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .pile-strip {
      display: grid;
      gap: 0.6rem;
    }

    .pile-box {
      background: rgba(15, 23, 42, 0.68);
      border: 1px solid rgba(148, 163, 184, 0.18);
      border-radius: 12px;
      padding: 0.7rem 0.9rem;
    }

    .title {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      gap: 12px;
    }

    .title h1 {
      margin: 0;
      font-size: 28px;
      letter-spacing: 0.08em;
    }

    .subtitle,
    .muted {
      color: var(--muted);
    }

    .battlefield {
      padding: 18px;
      display: flex;
      flex-direction: column;
      gap: 14px;
      min-height: calc(100vh - 36px);
    }

    .topbar,
    .actions,
    .skillbar,
    .hand {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }

    .pill,
    button {
      border: 1px solid var(--line);
      background: rgba(255, 255, 255, 0.05);
      color: var(--text);
      border-radius: 999px;
      padding: 10px 14px;
      cursor: pointer;
      transition: 0.2s ease;
      font: inherit;
    }

    button:hover:not(:disabled),
    .card:hover {
      transform: translateY(-2px);
      border-color: rgba(255, 255, 255, 0.32);
    }

    button:disabled {
      opacity: 0.45;
      cursor: not-allowed;
    }

    .primary {
      background: linear-gradient(135deg, rgba(123, 224, 184, 0.22), rgba(123, 224, 184, 0.06));
    }

    .skill-ready {
      background: linear-gradient(135deg, rgba(123, 224, 184, 0.18), rgba(123, 224, 184, 0.04));
      border-color: rgba(123, 224, 184, 0.34);
    }

    .skill-active {
      background: linear-gradient(135deg, rgba(247, 215, 116, 0.24), rgba(123, 224, 184, 0.14));
      border-color: rgba(247, 215, 116, 0.56);
      box-shadow: inset 0 0 22px rgba(123, 224, 184, 0.12), 0 0 0 1px rgba(247, 215, 116, 0.18);
    }

    .skill-blocked {
      background: linear-gradient(135deg, rgba(255, 158, 109, 0.16), rgba(255, 255, 255, 0.03));
      border-color: rgba(255, 158, 109, 0.34);
      color: #ffd9c7;
    }

    .phase-banner {
      display: grid;
      gap: 4px;
      padding: 14px 18px;
      border-radius: 18px;
      border: 1px solid rgba(247, 215, 116, 0.35);
      background:
        linear-gradient(135deg, rgba(247, 215, 116, 0.2), rgba(255, 255, 255, 0.03)),
        rgba(255, 255, 255, 0.04);
      box-shadow: inset 0 0 30px rgba(247, 215, 116, 0.08);
    }

    .phase-label {
      font-size: 12px;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      color: var(--gold);
    }

    .phase-name {
      font-size: 28px;
      font-weight: 800;
      letter-spacing: 0.08em;
    }

    .danger {
      background: linear-gradient(135deg, rgba(255, 111, 127, 0.22), rgba(255, 111, 127, 0.06));
    }

    .grid-wrap {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 260px;
      gap: 16px;
      align-items: start;
    }

    .grid {
      display: grid;
      grid-template-columns: repeat(20, minmax(18px, 1fr));
      gap: 6px;
      padding: 10px;
      background: rgba(255, 255, 255, 0.03);
      border-radius: 18px;
      border: 1px solid var(--line);
      aspect-ratio: 1 / 1;
    }

    .tile {
      position: relative;
      border-radius: 14px;
      background: var(--tile);
      border: 1px solid rgba(255, 255, 255, 0.04);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      color: rgba(255, 255, 255, 0.25);
      user-select: none;
    }

    .tile.reachable {
      background: var(--tile-hot);
      border-color: rgba(123, 224, 184, 0.45);
    }

    .tile.targetable {
      background: var(--tile-enemy);
      border-color: rgba(255, 111, 127, 0.45);
    }

    .tile.range-preview {
      background: linear-gradient(180deg, rgba(79, 127, 255, 0.2), rgba(79, 127, 255, 0.08));
      border-color: rgba(109, 145, 255, 0.42);
      box-shadow: inset 0 0 0 1px rgba(109, 145, 255, 0.26);
    }

    .tile.target-selected {
      background: rgba(247, 215, 116, 0.28);
      border-color: rgba(247, 215, 116, 0.8);
      box-shadow: inset 0 0 0 2px rgba(247, 215, 116, 0.4);
    }

    @keyframes jennyScenePulse {
      0% { filter: saturate(1) hue-rotate(0deg); }
      50% { filter: saturate(1.12) hue-rotate(-10deg); }
      100% { filter: saturate(1) hue-rotate(0deg); }
    }

    .tile.scene-jenny-finale {
      background:
        radial-gradient(circle at 30% 30%, rgba(199, 255, 225, 0.22), transparent 48%),
        linear-gradient(180deg, rgba(63, 168, 130, 0.42), rgba(24, 86, 69, 0.3));
      border-color: rgba(136, 255, 205, 0.38);
      box-shadow: inset 0 0 0 1px rgba(171, 255, 223, 0.08);
      animation: jennyScenePulse 2.4s ease-in-out infinite;
    }

    .unit {
      width: 78%;
      height: 78%;
      border-radius: 16px;
      display: grid;
      place-items: center;
      align-content: end;
      font-weight: 700;
      font-size: 10px;
      line-height: 1.1;
      text-align: center;
      padding: 4px;
      box-sizing: border-box;
      overflow: hidden;
      word-break: break-all;
      border: 1px solid rgba(255, 255, 255, 0.1);
      box-shadow: inset 0 0 24px rgba(255, 255, 255, 0.08);
    }

    .unit-label {
      max-width: 100%;
      padding: 3px 6px;
      border-radius: 999px;
      background: rgba(7, 12, 24, 0.72);
      color: #eef4ff;
      letter-spacing: 0.04em;
      text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    }

    .unit.player {
      background: linear-gradient(180deg, rgba(123, 224, 184, 0.95), rgba(38, 87, 72, 0.9));
      color: #08261c;
    }

    .unit.ai {
      background: linear-gradient(180deg, rgba(255, 158, 109, 0.95), rgba(111, 52, 29, 0.9));
      color: #2d1309;
    }

    .unit.role-jenny {
      background:
        linear-gradient(180deg, rgba(11, 18, 31, 0.06), rgba(11, 18, 31, 0.42)),
        url("pictures/Screenshot_20260317_142612.jpg") center / cover no-repeat;
      border-color: rgba(255, 232, 195, 0.52);
      box-shadow:
        inset 0 0 0 1px rgba(255, 249, 229, 0.12),
        inset 0 -22px 28px rgba(3, 7, 16, 0.48),
        0 0 18px rgba(248, 208, 140, 0.18);
      color: #fef7ea;
    }

    .floater {
      position: absolute;
      right: 2px;
      top: 2px;
      padding: 2px 6px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 800;
      background: rgba(15, 23, 42, 0.92);
      border: 1px solid rgba(255, 255, 255, 0.14);
      pointer-events: none;
    }

    .floater.damage {
      color: #ffd2d2;
      border-color: rgba(255, 111, 127, 0.45);
    }

    .floater.heal {
      color: #d6ffe3;
      border-color: rgba(123, 224, 184, 0.45);
    }

    .floater.break {
      color: #ffe7b0;
      border-color: rgba(247, 215, 116, 0.45);
    }

    .status-board,
    .log,
    .rules {
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid var(--line);
      border-radius: 18px;
      padding: 14px;
    }

    .status-card {
      padding: 14px;
      border-radius: 18px;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid var(--line);
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .status-head {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      align-items: center;
    }

    .bars {
      display: grid;
      gap: 8px;
    }

    .bar {
      display: grid;
      gap: 4px;
    }

    .bar-label {
      display: flex;
      justify-content: space-between;
      font-size: 12px;
      color: var(--muted);
    }

    .track {
      width: 100%;
      height: 10px;
      overflow: hidden;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.08);
    }

    .fill {
      height: 100%;
      border-radius: inherit;
      transition: width 0.25s ease;
    }

    .hp { background: linear-gradient(90deg, #ff7e88, #ffba7a); }
    .sp { background: linear-gradient(90deg, #89b6ff, #63e2ff); }
    .df { background: linear-gradient(90deg, #d8d8f6, #9eb5ff); }
    .bal { background: linear-gradient(90deg, #ffd86e, #f7a65d); }
    .sta { background: linear-gradient(90deg, #7be0b8, #4cb98f); }
    .shd { background: linear-gradient(90deg, #cfd7ff, #f0fbff); }

    .tags,
    .equip-list {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }

    .tag {
      font-size: 12px;
      padding: 5px 8px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.06);
      border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .tag.selected-tag {
      border-color: rgba(247, 215, 116, 0.9);
      background: rgba(247, 215, 116, 0.18);
      color: #fff6d0;
    }

    .tag.rule-effect {
      border: 1px solid rgba(224, 59, 59, 0.95);
      box-shadow: inset 0 0 0 1px rgba(255, 120, 120, 0.2);
      background: rgba(120, 18, 18, 0.22);
      color: #ffd7d7;
    }

    .hand {
      min-height: 196px;
      align-items: stretch;
    }

    .hand-panel {
      position: sticky;
      bottom: 0;
      padding: 14px;
      border-radius: 20px;
      border: 1px solid var(--line);
      background:
        linear-gradient(180deg, rgba(11, 15, 26, 0.7), rgba(11, 15, 26, 0.92)),
        rgba(255, 255, 255, 0.03);
      box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.22);
    }

    .hand-title {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      margin-bottom: 10px;
    }

    .card {
      width: 136px;
      min-height: 186px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      padding: 12px;
      border-radius: 18px;
      border: 1px solid var(--line);
      background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
        rgba(11, 15, 26, 0.9);
      cursor: pointer;
      transition: 0.2s ease;
    }

    .card.selected {
      outline: 2px solid var(--accent);
      transform: translateY(-4px);
    }

    .card.multi-selected {
      outline: 2px solid var(--gold);
      transform: translateY(-4px);
      background:
        linear-gradient(180deg, rgba(247, 215, 116, 0.16), rgba(255, 255, 255, 0.03)),
        rgba(11, 15, 26, 0.92);
    }

    .card.response-ready {
      border-color: rgba(123, 224, 184, 0.65);
      box-shadow: inset 0 0 0 1px rgba(123, 224, 184, 0.35);
    }

    .card.face-enhanced {
      border-color: rgba(255, 111, 127, 0.82);
      box-shadow: inset 0 0 0 1px rgba(255, 111, 127, 0.35), 0 0 0 1px rgba(255, 111, 127, 0.18);
      background:
        linear-gradient(180deg, rgba(255, 111, 127, 0.16), rgba(255, 255, 255, 0.03)),
        rgba(11, 15, 26, 0.92);
    }

    .card.enhance-material {
      border-style: dashed;
      border-color: rgba(247, 215, 116, 0.75);
      box-shadow: inset 0 0 0 1px rgba(247, 215, 116, 0.24);
    }

    .card-head,
    .card-foot {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      align-items: center;
    }

    .card-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin: 10px 0;
    }

    .card-badge {
      font-size: 11px;
      line-height: 1;
      padding: 6px 8px;
      border-radius: 999px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      background: rgba(255, 255, 255, 0.05);
      color: #dce7ff;
    }

    .card-type {
      font-size: 12px;
      color: var(--muted);
    }

    .point {
      font-size: 28px;
      font-weight: 800;
    }

    .red { color: #ff8d98; }
    .black { color: #d6def3; }

    .log {
      max-height: 280px;
      overflow: auto;
      display: grid;
      gap: 8px;
    }

    .log-entry {
      font-size: 13px;
      color: #d6def3;
      padding-bottom: 8px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .modal {
      position: fixed;
      inset: 0;
      display: none;
      align-items: center;
      justify-content: center;
      background: rgba(5, 8, 14, 0.72);
      padding: 24px;
      z-index: 20;
    }

    .modal.open {
      display: flex;
    }

    .modal-card {
      width: min(1100px, 96vw);
      max-height: 90vh;
      overflow: auto;
      padding: 22px;
      border-radius: 24px;
      border: 1px solid var(--line);
      background: linear-gradient(180deg, rgba(17, 25, 44, 0.98), rgba(10, 14, 24, 0.98));
      box-shadow: var(--shadow);
    }

    .modal-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      margin-bottom: 14px;
    }

    .rules {
      font-size: 13px;
      color: #d5dff5;
      line-height: 1.55;
    }

    .rules h3,
    .panel h2,
    .panel h3 {
      margin: 0 0 8px;
      font-size: 14px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--gold);
    }

    .kv {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      font-size: 13px;
    }

    .notice {
      color: var(--accent);
      font-size: 13px;
    }

    .equip-actions,
    .prompt-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 10px;
    }

    .home-choice.selected {
      border-color: rgba(247, 215, 116, 0.8);
      box-shadow: 0 0 0 2px rgba(247, 215, 116, 0.18);
      background: rgba(247, 215, 116, 0.08);
    }

    #homeModal .modal-card {
      width: min(1380px, 98vw);
      min-height: min(860px, 92vh);
      padding: 28px 30px;
      border-radius: 30px;
      background:
        radial-gradient(circle at top left, rgba(123, 224, 184, 0.14), transparent 22%),
        radial-gradient(circle at top right, rgba(247, 215, 116, 0.12), transparent 22%),
        linear-gradient(180deg, rgba(16, 24, 42, 0.98), rgba(8, 12, 20, 0.98));
    }

    .home-browser {
      display: grid;
      gap: 18px;
      min-height: 62vh;
      align-content: start;
    }

    .home-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 16px;
    }

    .home-grid.compact {
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .home-tile,
    .home-card {
      width: 100%;
      padding: 18px;
      border-radius: 20px;
      border: 1px solid rgba(193, 214, 255, 0.16);
      background: rgba(255, 255, 255, 0.035);
      color: var(--text);
      text-align: left;
      transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
    }

    .home-tile {
      display: grid;
      gap: 10px;
      cursor: pointer;
    }

    .home-tile:hover,
    .home-card:hover {
      transform: translateY(-2px);
      border-color: rgba(247, 215, 116, 0.34);
      background: rgba(247, 215, 116, 0.06);
      box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
    }

    .home-tile.primary,
    .home-card.selected {
      border-color: rgba(247, 215, 116, 0.8);
      background: rgba(247, 215, 116, 0.08);
      box-shadow: 0 0 0 2px rgba(247, 215, 116, 0.12);
    }

    .home-list {
      display: grid;
      gap: 14px;
    }

    .home-card-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 8px;
    }

    .home-section-title {
      font-size: 18px;
      font-weight: 700;
      color: var(--gold);
      letter-spacing: 0.04em;
    }

    .home-article {
      display: grid;
      gap: 16px;
    }

    .home-article-block {
      display: grid;
      gap: 8px;
      padding: 16px 18px;
      border-radius: 18px;
      background: rgba(255, 255, 255, 0.035);
      border: 1px solid rgba(193, 214, 255, 0.12);
    }

    .warning {
      margin-top: 10px;
      padding: 10px 12px;
      border-radius: 14px;
      background: rgba(255, 111, 127, 0.12);
      border: 1px solid rgba(255, 111, 127, 0.35);
      color: #ffd3d9;
      font-weight: 700;
    }

    .zone-panel {
      display: grid;
      gap: 10px;
      margin-top: 4px;
    }

    .zone-box {
      padding: 10px;
      border-radius: 14px;
      border: 1px solid rgba(255, 255, 255, 0.08);
      background: rgba(255, 255, 255, 0.03);
    }

    .zone-title {
      font-size: 12px;
      letter-spacing: 0.08em;
      color: var(--gold);
      margin-bottom: 8px;
    }

    .zone-content {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      min-height: 30px;
      align-items: center;
    }

    .prompt-title {
      font-size: 14px;
      color: var(--gold);
      margin-bottom: 6px;
    }

    .prompt-body {
      font-size: 13px;
      color: #dce7ff;
      line-height: 1.55;
    }

    @media (max-width: 1180px) {
      .app {
        grid-template-columns: 1fr;
      }

      .grid-wrap {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 720px) {
      .app,
      .battlefield,
      .side {
        padding: 12px;
      }

      .card {
        width: calc(50% - 6px);
        min-width: 136px;
      }

      .grid {
        gap: 4px;
      }
    }
