      .map-panel {
        --map-node-size: 32px;
        position: relative;
        min-height: 346px;
        padding: 28px 14px 14px;
        border-radius: 18px;
        overflow: visible;
        background:
          radial-gradient(circle at top, rgba(227, 180, 93, 0.2), transparent 38%),
          linear-gradient(180deg, rgba(255, 245, 220, 0.08), rgba(255, 245, 220, 0.03));
        border: 1px solid rgba(255, 219, 151, 0.14);
        box-shadow: inset 0 1px 0 rgba(255, 247, 232, 0.06);
      }

      .map-panel::before {
        content: "";
        position: absolute;
        inset: 10px;
        border-radius: 14px;
        border: 1px solid rgba(255, 219, 151, 0.08);
        background:
          linear-gradient(rgba(255, 219, 151, 0.04) 1px, transparent 1px),
          linear-gradient(90deg, rgba(255, 219, 151, 0.04) 1px, transparent 1px);
        background-size: 26px 26px;
        pointer-events: none;
      }

      .map-grid {
        position: relative;
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        grid-template-rows: repeat(4, 1fr);
        gap: 8px;
        min-height: 316px;
        align-items: stretch;
        justify-items: center;
        align-content: start;
        overflow: visible;
      }

      .map-connector {
        position: absolute;
        z-index: 0;
        pointer-events: none;
        border-radius: 999px;
        background: linear-gradient(90deg, rgba(255, 220, 130, 0.06), rgba(255, 220, 130, 0.5), rgba(186, 242, 199, 0.16));
        box-shadow: 0 0 0 1px rgba(255, 220, 130, 0.08), 0 0 16px rgba(255, 220, 130, 0.16);
        opacity: 0.9;
      }

      .map-connector.vertical {
        background: linear-gradient(180deg, rgba(255, 220, 130, 0.06), rgba(255, 220, 130, 0.5), rgba(186, 242, 199, 0.16));
      }

      .map-node {
        display: flex;
        align-items: center;
        justify-content: center;
        width: var(--map-node-size);
        height: var(--map-node-size);
        min-height: 0;
        border-radius: 10px;
        text-align: center;
        font-size: 0.8rem;
        line-height: 1;
        padding: 4px;
        position: relative;
        overflow: visible;
        z-index: 1;
        transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
      }

      .map-node.hidden {
        color: transparent;
        background: transparent;
        border: 0;
        box-shadow: none;
        padding: 0;
      }

      .map-node.visited {
        background:
          linear-gradient(180deg, rgba(186, 242, 199, 0.16), rgba(113, 160, 121, 0.08));
        color: var(--text);
        border: 1px solid rgba(186, 242, 199, 0.24);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 18px rgba(18, 12, 8, 0.18);
      }

      .map-node.visited:hover {
        transform: translateY(-1px);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 14px 22px rgba(18, 12, 8, 0.22);
      }

      .map-node:focus-visible {
        outline: 3px solid rgba(255, 220, 130, 0.98);
        outline-offset: 3px;
      }

      .map-node.visited:hover::before,
      .map-node.visited:focus-visible::before {
        opacity: 1;
        transform: translate(-50%, -4px);
      }

      .map-node.visited::before {
        content: attr(data-room-name);
        position: absolute;
        left: 50%;
        bottom: calc(100% + 10px);
        transform: translate(-50%, 2px);
        min-width: 84px;
        max-width: 144px;
        padding: 6px 9px;
        border-radius: 10px;
        background: rgba(24, 16, 9, 0.96);
        border: 1px solid rgba(255, 220, 130, 0.24);
        box-shadow: 0 14px 24px rgba(18, 12, 8, 0.28);
        color: var(--text);
        font-size: 0.7rem;
        line-height: 1.2;
        text-align: center;
        letter-spacing: 0.01em;
        white-space: normal;
        text-wrap: balance;
        pointer-events: none;
        opacity: 0;
        transition: opacity 140ms ease, transform 140ms ease;
        z-index: 4;
      }

      .map-node.visited::after {
        content: "";
        position: absolute;
        left: 50%;
        bottom: calc(100% + 4px);
        width: 10px;
        height: 10px;
        background: rgba(24, 16, 9, 0.96);
        border-right: 1px solid rgba(255, 220, 130, 0.24);
        border-bottom: 1px solid rgba(255, 220, 130, 0.24);
        transform: translateX(-50%) rotate(45deg);
        opacity: 0;
        transition: opacity 140ms ease;
        pointer-events: none;
      }

      .map-node.visited:hover::after,
      .map-node.visited:focus-visible::after {
        opacity: 1;
      }

      .map-node.current {
        background:
          radial-gradient(circle at top left, rgba(255, 231, 162, 0.2), transparent 55%),
          linear-gradient(180deg, rgba(227, 180, 93, 0.28), rgba(136, 88, 26, 0.18));
        border: 1px solid rgba(255, 220, 130, 0.65);
        box-shadow: 0 0 0 2px rgba(255, 220, 130, 0.18), 0 16px 28px rgba(70, 42, 8, 0.28);
      }

      .map-node.current .map-node-rune {
        background: rgba(48, 30, 8, 0.42);
        color: #fff0b0;
      }

      .map-node-current-dot {
        position: absolute;
        top: 4px;
        right: 4px;
        width: 6px;
        height: 6px;
        border-radius: 999px;
        background: #fff2bf;
        box-shadow: 0 0 0 4px rgba(255, 220, 130, 0.14), 0 0 14px rgba(255, 220, 130, 0.6);
      }

      .map-node-rune {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 22px;
        height: 22px;
        padding: 0 4px;
        border-radius: 6px;
        background: rgba(22, 17, 12, 0.26);
        color: var(--accent);
        font-size: 0.56rem;
        letter-spacing: 0.16em;
        text-transform: uppercase;
      }

      .map-node-name {
        display: none;
      }

      .icon-btn {
        min-width: 46px;
        min-height: 46px;
        padding: 0;
        border-radius: 12px;
        font-size: 1.18rem;
      }

      .icon-btn i,
      .selector-nav i {
        pointer-events: none;
      }

      .cmd-link i {
        pointer-events: none;
      }

      select {
        width: 100%;
        border: 1px solid rgba(255, 219, 151, 0.2);
        border-radius: 12px;
        padding: 10px 12px;
        font: inherit;
        color: var(--text);
        background: rgba(255, 245, 220, 0.07);
      }

      option {
        color: #201207;
      }

      .language-picker {
        position: relative;
      }

      .language-trigger {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 12px;
        border-radius: 12px;
        border: 1px solid rgba(255, 219, 151, 0.2);
        background: rgba(255, 245, 220, 0.07);
        color: var(--text);
        font: inherit;
        cursor: pointer;
      }

      .language-trigger::after {
        content: "▾";
        color: var(--accent);
        font-size: 0.9rem;
        flex: 0 0 auto;
      }

      .language-trigger-label {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .language-menu {
        position: fixed;
        z-index: 40;
        width: min(260px, calc(100vw - 32px));
        max-height: min(320px, calc(100vh - 32px));
        padding: 6px;
        border-radius: 16px;
        border: 1px solid rgba(255, 219, 151, 0.22);
        background: rgba(34, 21, 10, 0.98);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
        overflow: auto;
      }

      .language-menu.hidden {
        display: none;
      }

      .language-option {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 12px;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: var(--text);
        font: inherit;
        text-align: left;
        cursor: pointer;
      }

      .language-option:hover,
      .language-option:focus-visible {
        background: rgba(255, 245, 220, 0.09);
      }

      .language-option.active {
        background: rgba(227, 180, 93, 0.18);
        color: #fff3cb;
      }

      .language-option.active::after {
        content: "✓";
        color: var(--accent);
      }

      .command-picker {
        position: relative;
      }

      .command-trigger {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 12px;
        border-radius: 12px;
        border: 1px solid rgba(255, 219, 151, 0.2);
        background: rgba(255, 245, 220, 0.07);
        color: var(--text);
        font: inherit;
        cursor: pointer;
      }

      .command-trigger::after {
        content: "▾";
        color: var(--accent);
        font-size: 0.9rem;
        flex: 0 0 auto;
      }

      .command-trigger:disabled {
        opacity: 0.45;
        cursor: not-allowed;
        filter: grayscale(0.25);
      }

      .command-trigger-label {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .command-menu {
        position: fixed;
        z-index: 40;
        width: min(360px, calc(100vw - 32px));
        max-height: min(320px, calc(100vh - 32px));
        padding: 6px;
        border-radius: 16px;
        border: 1px solid rgba(255, 219, 151, 0.22);
        background: rgba(34, 21, 10, 0.98);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
        overflow: auto;
      }

      .command-menu.hidden {
        display: none;
      }

      .command-option {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 12px;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: var(--text);
        font: inherit;
        text-align: left;
        cursor: pointer;
      }

      .command-option:hover,
      .command-option:focus-visible {
        background: rgba(255, 245, 220, 0.09);
      }

      .command-option.active {
        background: rgba(227, 180, 93, 0.18);
        color: #fff3cb;
      }

      .command-option.active::after {
        content: "✓";
        color: var(--accent);
      }

      .say-row {
        display: grid;
        grid-template-columns: 96px auto 1fr;
        gap: 8px;
      }

      .chip {
        padding: 6px 9px;
        border-radius: 999px;
        background: rgba(186, 242, 199, 0.1);
        color: var(--accent-2);
        font-size: 0.95rem;
        border: 0;
        cursor: pointer;
        font-family: inherit;
      }

      .chip:hover,
      .cmd-link:hover {
        filter: brightness(1.08);
      }

      button:disabled,
      select:disabled,
      input:disabled {
        opacity: 0.45;
        cursor: not-allowed;
        filter: grayscale(0.25);
      }

      .chip:focus-visible,
      .cmd-link:focus-visible,
      select:focus-visible,
      input:focus-visible,
      a:focus-visible {
        outline: 3px solid rgba(255, 220, 130, 0.98);
        outline-offset: 3px;
      }

      .room-info {
        display: grid;
        gap: 6px;
      }

      .room-section {
        padding: 6px 8px;
        border-radius: 8px;
        background: rgba(255, 245, 220, 0.04);
      }

      .room-section-label {
        display: block;
        color: var(--muted);
        font-size: 0.65rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        margin-bottom: 2px;
      }

      .room-section-list {
        color: var(--text);
        font-size: 0.82rem;
        line-height: 1.3;
      }

      .room-section-empty {
        color: var(--muted);
        font-style: italic;
      }

      .room-item {
        padding: 1px 0;
      }

      .room-item:first-child {
        padding-top: 0;
      }

      .room-item:last-child {
        padding-bottom: 0;
      }

      .party-section {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid rgba(255, 219, 151, 0.14);
      }

      .party-members-section {
        margin-bottom: 12px;
      }

      .party-members-list {
        margin-top: 6px;
        display: flex;
        flex-direction: column;
        gap: 4px;
      }

      .party-member {
        font-size: 0.85rem;
        color: var(--text);
        padding: 4px 8px;
        background: rgba(255, 245, 220, 0.06);
        border-radius: 4px;
        border: 1px solid rgba(255, 219, 151, 0.1);
      }

      .party-display {
        display: flex;
        align-items: center;
        gap: 8px;
      }

      .party-id {
        font-family: var(--font-mono);
        background: rgba(255, 220, 130, 0.15);
        padding: 2px 8px;
        border-radius: 4px;
        font-size: 0.9rem;
      }

      .party-id.hidden {
        display: none;
      }

      .party-actions {
        margin-top: 8px;
        display: flex;
        flex-direction: column;
        gap: 6px;
      }

      .party-btn {
        padding: 6px 10px;
        border-radius: 8px;
        border: 1px solid rgba(255, 219, 151, 0.3);
        background: rgba(255, 245, 220, 0.08);
        color: var(--text);
        font: inherit;
        font-size: 0.85rem;
        cursor: pointer;
        transition: background 140ms ease, border-color 140ms ease;
      }

      .party-btn:hover {
        background: rgba(255, 245, 220, 0.15);
        border-color: rgba(255, 220, 130, 0.5);
      }

      .party-join-row {
        display: flex;
        gap: 6px;
      }

      .party-input {
        flex: 1;
        min-width: 0;
        padding: 6px 8px;
        border-radius: 8px;
        border: 1px solid rgba(255, 219, 151, 0.2);
        background: rgba(255, 245, 220, 0.07);
        color: var(--text);
        font: inherit;
        font-size: 0.85rem;
        text-transform: uppercase;
      }

      .party-input::placeholder {
        text-transform: none;
        color: var(--muted);
      }

      .party-password-input {
        text-transform: none;
      }

      .party-join-password-input {
        text-transform: none;
      }

      .party-modal-content {
        display: flex;
        flex-direction: column;
        gap: 16px;
      }

      .party-modal-status {
        padding: 8px 12px;
        border-radius: 8px;
        background: rgba(255, 245, 220, 0.1);
        border: 1px solid rgba(255, 219, 151, 0.2);
      }

      .party-modal-section {
        display: flex;
        flex-direction: column;
        gap: 8px;
      }

      .party-modal-section.hidden {
        display: none;
      }

      .party-modal-row {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
      }

      .party-modal-row .party-input {
        flex: 1;
        min-width: 120px;
      }

      .party-btn-danger {
        background: rgba(255, 100, 100, 0.15);
        border-color: rgba(255, 100, 100, 0.3);
        color: #ff9999;
      }

      .party-btn-danger:hover {
        background: rgba(255, 100, 100, 0.25);
        border-color: rgba(255, 100, 100, 0.5);
      }

      .party-code-input {
        max-width: 100px;
        text-transform: uppercase;
      }

      .held-cards-section {
        margin-top: 16px;
        padding-top: 12px;
        border-top: 1px solid rgba(255, 219, 151, 0.14);
      }

      .held-cards-label {
        color: var(--muted);
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        margin-bottom: 8px;
      }

      .held-cards-list {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }

      .held-card {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        padding: 8px 12px;
        border-radius: 8px;
        border: 1px solid rgba(255, 219, 151, 0.3);
        background: rgba(255, 245, 220, 0.08);
        cursor: pointer;
        transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
        min-width: 60px;
        max-width: 100px;
      }

      .held-card:hover {
        background: rgba(255, 245, 220, 0.15);
        border-color: rgba(255, 220, 130, 0.5);
        transform: translateY(-2px);
      }

      .held-card-icon {
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        background: rgba(22, 17, 12, 0.4);
        margin-bottom: 4px;
        color: #888;
        font-size: 0.75rem;
      }

      .held-card-name {
        color: var(--text);
        font-size: 0.75rem;
        text-align: center;
        line-height: 1.2;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
      }

      .held-card.door {
        border-color: rgba(186, 242, 199, 0.3);
        background: rgba(186, 242, 199, 0.08);
      }

      .held-card.treasure {
        border-color: rgba(255, 220, 130, 0.3);
        background: rgba(255, 245, 220, 0.08);
      }

      .held-card.monster {
        border-color: rgba(255, 100, 100, 0.3);
        background: rgba(255, 100, 100, 0.08);
      }

      .held-card.curse {
        border-color: rgba(180, 100, 255, 0.3);
        background: rgba(180, 100, 255, 0.08);
      }

      .card-modal {
        max-width: 400px;
      }

      .card-modal-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 16px;
      }

      .card-modal-header h2 {
        margin: 0;
        font-size: 1.25rem;
        color: var(--text);
      }

      .card-modal-close {
        background: none;
        border: none;
        color: var(--muted);
        font-size: 1.25rem;
        cursor: pointer;
        padding: 4px;
        line-height: 1;
      }

      .card-modal-close:hover {
        color: var(--text);
      }

      .card-modal-image {
        width: 100%;
        height: 180px;
        border-radius: 8px;
        background: rgba(255, 245, 220, 0.05);
        border: 1px dashed rgba(255, 219, 151, 0.2);
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 16px;
        color: var(--muted);
        font-size: 0.8rem;
      }

      .card-modal-body {
        display: flex;
        flex-direction: column;
        gap: 12px;
      }

      .card-modal-type {
        display: inline-block;
        padding: 4px 12px;
        border-radius: 999px;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        background: rgba(255, 245, 220, 0.1);
        border: 1px solid rgba(255, 219, 151, 0.2);
        color: var(--text);
        align-self: flex-start;
      }

      .card-modal-type.monster {
        background: rgba(255, 100, 100, 0.15);
        border-color: rgba(255, 100, 100, 0.3);
        color: #ff9999;
      }

      .card-modal-type.curse {
        background: rgba(180, 100, 255, 0.15);
        border-color: rgba(180, 100, 255, 0.3);
        color: #cc99ff;
      }

      .card-modal-type.equipment {
        background: rgba(255, 220, 130, 0.15);
        border-color: rgba(255, 220, 130, 0.3);
        color: #fff3cb;
      }

      .card-modal-type.potion {
        background: rgba(186, 242, 199, 0.15);
        border-color: rgba(186, 242, 199, 0.3);
        color: #baf7c7;
      }

      .card-modal-description {
        color: var(--text);
        line-height: 1.5;
      }

      .card-modal-flavor {
        color: var(--muted);
        font-style: italic;
        font-size: 0.9rem;
        line-height: 1.4;
      }

      .card-modal-stats {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 8px;
      }

      .card-stat {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 4px 10px;
        border-radius: 6px;
        background: rgba(255, 245, 220, 0.08);
        border: 1px solid rgba(255, 219, 151, 0.15);
        color: var(--text);
        font-size: 0.8rem;
      }

      .card-stat-label {
        color: var(--muted);
        font-size: 0.7rem;
        text-transform: uppercase;
      }

      .held-cards-empty {
        color: var(--muted);
        font-size: 0.8rem;
      }

      .desk-card {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 8px 12px;
        border-radius: 8px;
        border: 1px solid rgba(255, 219, 151, 0.3);
        background: linear-gradient(180deg, rgba(255, 245, 220, 0.08), rgba(255, 245, 220, 0.04));
        color: var(--text);
        font-size: 0.85rem;
        cursor: pointer;
        transition: transform 140ms ease, box-shadow 140ms ease;
        width: 192px;
        height: 120px;
        text-align: center;
      }

      .desk-card:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
      }

      .desk-card.monster {
        border-color: rgba(255, 100, 100, 0.4);
        background: linear-gradient(180deg, rgba(255, 100, 100, 0.15), rgba(200, 50, 50, 0.08));
      }

      .desk-card-icon {
        width: 20px;
        text-align: center;
      }

      .desk-card-name {
        font-weight: 500;
      }

      .monster-card {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 16px;
        border-radius: 12px;
        border: 1px solid rgba(255, 100, 100, 0.4);
        background: linear-gradient(180deg, rgba(255, 100, 100, 0.12), rgba(200, 50, 50, 0.06));
        width: 192px;
        height: 300px;
      }

      .monster-card-header {
        display: flex;
        align-items: center;
        gap: 8px;
      }

      .monster-card-icon {
        font-size: 1.5rem;
        color: rgba(255, 100, 100, 0.8);
      }

      .monster-card-title {
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--text);
      }

      .monster-card-stats {
        display: flex;
        flex-direction: column;
        gap: 4px;
      }

      .monster-card-stat {
        display: flex;
        justify-content: space-between;
        font-size: 0.85rem;
      }

      .monster-card-stat-label {
        color: var(--muted);
      }

      .monster-card-stat-value {
        font-weight: 500;
      }

      .monster-card-description {
        font-size: 0.85rem;
        color: var(--muted);
        line-height: 1.4;
        margin-top: 4px;
      }

      .monster-card-flavor {
        font-size: 0.8rem;
        color: var(--muted);
        font-style: italic;
        opacity: 0.8;
        margin-top: 4px;
      }

      .monster-total {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 12px 16px;
        margin: 8px 0;
        border-radius: 8px;
        background: linear-gradient(180deg, rgba(255, 100, 100, 0.15), rgba(200, 50, 50, 0.08));
        border: 1px solid rgba(255, 100, 100, 0.3);
      }

      .monster-total-label {
        font-size: 0.9rem;
        color: var(--muted);
      }

      .monster-total-value {
        font-size: 1.2rem;
        font-weight: 700;
        color: rgba(255, 100, 100, 0.9);
      }
      
      .party-required-notice {
        margin-top: 16px;
        padding: 16px;
        border-radius: 12px;
        background: rgba(255, 100, 100, 0.1);
        border: 1px solid rgba(255, 100, 100, 0.3);
      }

      .party-required-notice.hidden {
        display: none;
      }

      .party-required-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        text-align: center;
      }

      .party-required-content i {
        font-size: 2rem;
        color: rgba(255, 150, 150, 0.8);
      }

      .party-required-content span {
        color: var(--text);
        font-size: 0.9rem;
      }

      .card-draw-section.disabled {
        opacity: 0.4;
        pointer-events: none;
      }

      .card-modal-actions {
        margin-top: 16px;
        display: flex;
        justify-content: center;
      }

      .card-use-btn {
        padding: 10px 24px;
        border-radius: 12px;
        border: 1px solid rgba(255, 219, 151, 0.4);
        background: linear-gradient(180deg, rgba(227, 180, 93, 0.3), rgba(136, 88, 26, 0.2));
        color: #fff3cb;
        font: inherit;
        font-weight: 600;
        font-size: 0.95rem;
        cursor: pointer;
        transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
      }

      .card-use-btn:hover {
        background: linear-gradient(180deg, rgba(227, 180, 93, 0.5), rgba(136, 88, 26, 0.3));
        border-color: rgba(255, 219, 151, 0.7);
        transform: translateY(-1px);
      }

      .card-use-btn:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
      }

      .card-use-btn-secondary {
        background: linear-gradient(180deg, rgba(100, 150, 200, 0.3), rgba(50, 80, 120, 0.2));
        border-color: rgba(150, 180, 220, 0.4);
        color: #c7d9ed;
      }

      .card-use-btn-secondary:hover {
        background: linear-gradient(180deg, rgba(100, 150, 200, 0.5), rgba(50, 80, 120, 0.3));
        border-color: rgba(150, 180, 220, 0.7);
      }

      .card-use-btn-danger {
        background: linear-gradient(180deg, rgba(200, 100, 100, 0.3), rgba(120, 50, 50, 0.2));
        border-color: rgba(220, 150, 150, 0.4);
        color: #f7c7c7;
      }

      .card-use-btn-danger:hover {
        background: linear-gradient(180deg, rgba(200, 100, 100, 0.5), rgba(120, 50, 50, 0.3));
        border-color: rgba(220, 150, 150, 0.7);
      }

      .card-give-container {
        margin-top: 12px;
        width: 100%;
      }

      .card-give-select {
        width: 100%;
        padding: 10px 16px;
        border-radius: 12px;
        border: 1px solid rgba(255, 219, 151, 0.4);
        background: linear-gradient(180deg, rgba(80, 60, 120, 0.3), rgba(40, 30, 80, 0.2));
        color: #e7d9f7;
        font: inherit;
        font-size: 0.9rem;
        cursor: pointer;
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23e7d9f7' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 16px center;
      }

      .card-give-select:hover {
        border-color: rgba(255, 219, 151, 0.7);
        background-color: rgba(100, 80, 160, 0.3);
      }

      .card-give-select:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
      }

      .turn-section {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid rgba(255, 219, 151, 0.1);
      }

      .turn-section.hidden {
        display: none;
      }

      .end-turn-btn {
        width: 100%;
        margin-top: 8px;
        padding: 8px 16px;
        border-radius: 8px;
        border: 1px solid rgba(100, 200, 100, 0.4);
        background: linear-gradient(180deg, rgba(100, 200, 100, 0.2), rgba(50, 100, 50, 0.2));
        color: #baf7c7;
        font: inherit;
        font-weight: 600;
        font-size: 0.85rem;
        cursor: pointer;
        transition: background 140ms ease, border-color 140ms ease;
      }

      .end-turn-btn:hover {
        background: linear-gradient(180deg, rgba(100, 200, 100, 0.35), rgba(50, 100, 50, 0.3));
        border-color: rgba(100, 200, 100, 0.6);
      }

      .end-turn-btn:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
      }

      .end-turn-btn.hidden {
        display: none;
      }

      .start-game-btn {
        width: 100%;
        margin-top: 8px;
        padding: 10px 16px;
        border-radius: 8px;
        border: 1px solid rgba(100, 200, 100, 0.4);
        background: linear-gradient(180deg, rgba(100, 200, 100, 0.3), rgba(50, 100, 50, 0.2));
        color: #baf7c7;
        font: inherit;
        font-weight: 600;
        font-size: 0.9rem;
        cursor: pointer;
        transition: background 140ms ease, border-color 140ms ease;
      }

      .start-game-btn:hover {
        background: linear-gradient(180deg, rgba(100, 200, 100, 0.45), rgba(50, 100, 50, 0.35));
        border-color: rgba(100, 200, 100, 0.7);
      }

      .start-game-btn:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
      }

      .start-game-btn.hidden {
        display: none;
      }

      .open-party-btn {
        width: 100%;
        margin-top: 12px;
        padding: 8px 12px;
        border-radius: 8px;
        border: 1px solid rgba(255, 219, 151, 0.3);
        background: rgba(255, 245, 220, 0.07);
        color: var(--text);
        font: inherit;
        font-size: 0.85rem;
        cursor: pointer;
        transition: background 140ms ease, border-color 140ms ease;
      }

      .open-party-btn:hover {
        background: rgba(255, 245, 220, 0.12);
        border-color: rgba(255, 219, 151, 0.5);
      }

      .open-party-btn:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
      }

      .debug-modal {
        max-width: 900px;
        max-height: 80vh;
        display: flex;
        flex-direction: column;
      }

      .debug-modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px;
        border-bottom: 1px solid rgba(255, 219, 151, 0.2);
      }

      .debug-modal-header h2 {
        margin: 0;
        font-size: 1.1rem;
        color: var(--text);
      }

      .debug-tabs {
        display: flex;
        border-bottom: 1px solid rgba(255, 219, 151, 0.2);
        padding: 0 16px;
        gap: 4px;
      }

      .debug-tab {
        padding: 8px 16px;
        background: transparent;
        border: none;
        border-bottom: 2px solid transparent;
        color: var(--muted);
        font-size: 0.9rem;
        cursor: pointer;
        transition: color 140ms ease, border-color 140ms ease;
      }

      .debug-tab:hover {
        color: var(--text);
      }

      .debug-tab.active {
        color: var(--accent);
        border-bottom-color: var(--accent);
      }

      .debug-content {
        flex: 1;
        overflow: auto;
        min-height: 0;
      }

      .debug-panel {
        margin: 0;
        padding: 16px;
        font-family: 'JetBrains Mono', 'Fira Code', monospace;
        font-size: 0.8rem;
        line-height: 1.5;
        white-space: pre-wrap;
        word-break: break-word;
        color: var(--text);
        background: transparent;
      }

      .debug-btn.active {
        background: rgba(255, 219, 151, 0.2);
        color: var(--accent);
      }

      .head-action-btn.debug-btn {
        display: flex;
        align-items: center;
        justify-content: center;
      }

      .combat-actions {
        display: flex;
        justify-content: center;
        gap: 12px;
        margin: 16px 0;
        padding: 16px;
        background: rgba(255, 100, 100, 0.08);
        border: 1px solid rgba(255, 100, 100, 0.2);
        border-radius: 12px;
      }

      .combat-actions.hidden {
        display: none;
      }

      .combat-btn {
        padding: 12px 32px;
        border-radius: 12px;
        border: 1px solid rgba(100, 200, 100, 0.4);
        background: linear-gradient(180deg, rgba(100, 200, 100, 0.3), rgba(50, 100, 50, 0.2));
        color: #baf7c7;
        font: inherit;
        font-weight: 600;
        font-size: 1rem;
        cursor: pointer;
        transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
      }

      .combat-btn:hover {
        background: linear-gradient(180deg, rgba(100, 200, 100, 0.45), rgba(50, 100, 50, 0.35));
        border-color: rgba(100, 200, 100, 0.7);
        transform: translateY(-2px);
      }

      .combat-btn:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
      }

      .combat-btn-secondary {
        background: linear-gradient(180deg, rgba(200, 150, 100, 0.3), rgba(120, 80, 40, 0.2));
        border-color: rgba(220, 180, 120, 0.4);
        color: #f7e7c7;
      }

      .combat-btn-secondary:hover {
        background: linear-gradient(180deg, rgba(200, 150, 100, 0.45), rgba(120, 80, 40, 0.35));
        border-color: rgba(220, 180, 120, 0.7);
      }

      .card-type-section {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid rgba(255, 219, 151, 0.14);
      }

      .card-type-section.hidden {
        display: none;
      }

      .card-type-buttons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-top: 8px;
      }

      .card-type-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 8px 6px;
        border-radius: 8px;
        border: 1px solid rgba(255, 219, 151, 0.3);
        background: rgba(255, 245, 220, 0.06);
        color: var(--text);
        font: inherit;
        font-size: 0.75rem;
        cursor: pointer;
        transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
      }

      .card-type-btn i {
        font-size: 1.1rem;
      }

      .card-type-btn:hover {
        background: rgba(255, 245, 220, 0.15);
        border-color: rgba(255, 220, 130, 0.5);
        transform: translateY(-1px);
      }

      .card-type-btn:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
      }

      .card-type-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
      }

      .dialog-modal {
        max-width: 480px;
      }

      .dialog-modal-header {
        margin-bottom: 16px;
      }

      .dialog-modal-header h2 {
        margin: 0;
        font-size: 1.2rem;
        color: var(--text);
      }

      .dialog-modal-body {
        color: var(--text);
        line-height: 1.6;
        font-size: 0.95rem;
      }

      .dialog-modal-body p {
        margin: 0 0 12px 0;
      }

      .dialog-modal-body p:last-child {
        margin-bottom: 0;
      }

      .dialog-modal-body ul {
        margin: 8px 0;
        padding-left: 20px;
      }

      .dialog-modal-body li {
        margin: 4px 0;
      }

      .dialog-modal-actions {
        margin-top: 20px;
        display: flex;
        justify-content: center;
      }

      .dialog-modal-actions button {
        padding: 10px 24px;
        border-radius: 12px;
        border: 1px solid rgba(255, 219, 151, 0.4);
        background: linear-gradient(180deg, rgba(227, 180, 93, 0.3), rgba(136, 88, 26, 0.2));
        color: #fff3cb;
        font: inherit;
        font-weight: 600;
        font-size: 0.95rem;
        cursor: pointer;
        transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
      }

      .dialog-modal-actions button:hover {
        background: linear-gradient(180deg, rgba(227, 180, 93, 0.5), rgba(136, 88, 26, 0.3));
        border-color: rgba(255, 219, 151, 0.7);
        transform: translateY(-1px);
      }

      .dialog-modal-body .info-box {
        padding: 12px 16px;
        border-radius: 8px;
        background: rgba(255, 245, 220, 0.1);
        border: 1px solid rgba(255, 219, 151, 0.2);
        margin: 12px 0;
      }

      .dialog-modal-body .warning-box {
        padding: 12px 16px;
        border-radius: 8px;
        background: rgba(255, 180, 100, 0.15);
        border: 1px solid rgba(255, 180, 100, 0.3);
        margin: 12px 0;
      }

      .dialog-modal-body .error-box {
        padding: 12px 16px;
        border-radius: 8px;
        background: rgba(255, 100, 100, 0.15);
        border: 1px solid rgba(255, 100, 100, 0.3);
        margin: 12px 0;
      }

      .dialog-modal-body .success-box {
        padding: 12px 16px;
        border-radius: 8px;
        background: rgba(100, 200, 100, 0.15);
        border: 1px solid rgba(100, 200, 100, 0.3);
        margin: 12px 0;
      }
