/* genesis/web-app/styles/page-dashboard.css */
/* 対象: swap-dashboard.html, transfer-dashboard.html, faucet.html, migration.html */

/* =========================================
   Container (ダッシュボード専用の横幅制限)
========================================= */
.dashboard-container {
    width: 100%;
    max-width: 480px;
    margin: 40px auto 0 auto;
}

/* =========================================
   Typography & Headers
========================================= */
.header-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.network-badge {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-cyan);
    text-shadow: 0 0 10px var(--primary-glow);
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
}

.network-badge.swap-badge {
    color: var(--accent-amber);
    text-shadow: 0 0 10px var(--amber-glow);
}

.wallet-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* =========================================
   タブ切り替えコンポーネント (Tab Navigation & Panels)
========================================= */

/* タブボタンを包む親枠（横並びのスイッチ台） */
.tab-navigation {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
}

/* 3タブ用（transfer-dashboard用）の分割設定 */
.tab-navigation.tab-col-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* 各タブボタン（スイッチ本体） */
.tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 10px 4px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ボタンにマウスを乗せたときの反応 */
.tab-btn:hover:not(.active) {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

/* 選ばれているタブボタン（アクティブ状態：青く発光） */
.tab-btn.active {
    background: rgba(0, 229, 255, 0.12);
    color: var(--primary-cyan);
    border-color: var(--primary-cyan);
    box-shadow: 0 0 10px var(--primary-glow);
    text-shadow: 0 0 5px var(--primary-glow);
}

/* 日本語モード時のフォント調整（文字の形を美しく保つ） */
body.lang-ja .tab-btn {
    font-family: 'Noto Serif JP', serif;
    font-size: 0.85rem;
    letter-spacing: 0;
}

/* 引き出しの箱（各タブの中身） */
.tab-panel {
    display: block;
    animation: fadeInTab 0.25s ease-out;
}

/* 隠すルール（ルール20に準拠） */
.tab-panel.is-hidden {
    display: none !important;
}

/* パネルが切り替わったときの優しいフェードイン */
@keyframes fadeInTab {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   Cards & Layouts
========================================= */
.total-label {
    color: var(--text-muted);
    font-size: 1.2rem;
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
}

.total-amount {
    font-size: 2.2em;
    font-weight: 800;
    margin: 5px 0;
    color: #fff;
    font-family: monospace;
}

.chart-container {
    position: relative;
    height: 220px;
    margin: 20px 0;
}

.asset-list-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-dark);
    padding: 10px;
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.2);
}

.asset-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-dark);
    transition: background-color 0.2s;
    cursor: pointer;
}

.asset-item:hover {
    background-color: rgba(0, 229, 255, 0.02);
}

.asset-info {
    display: flex;
    align-items: center;
}

.asset-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
}

.asset-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.asset-name {
    font-weight: 700;
    font-size: 1.1em;
    font-family: 'Cinzel', serif;
    line-height: 1.1;
    margin-bottom: 2px;
}

.asset-rate-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.asset-values {
    text-align: right;
}

.asset-native {
    font-weight: 600;
    font-size: 1.1em;
    font-family: monospace;
}

.asset-fiat {
    color: var(--text-muted);
    font-size: 0.9em;
}

/* =========================================
   Forms & Inputs (Transfer & Swap共通)
========================================= */
.section-heading {
    font-weight: 800;
    font-size: 1.8em;
    margin-bottom: 15px;
    font-family: 'Cinzel', serif;
    color: var(--accent-amber);
    border-bottom: 1px solid var(--border-dark);
    padding-bottom: 8px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 1em;
    font-weight: bold;
    color: var(--text-main);
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
}

.input-container-rel {
    position: relative;
    width: 100%;
    flex: 3;
}

.input-with-btn {
    padding-right: 75px;
    color: var(--accent-amber);
    text-shadow: 0 0 5px rgba(230, 171, 8, 0.2);
}

.btn-inside-input {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #222;
    color: var(--text-muted);
    border: 1px solid var(--border-dark);
    padding: 5px 10px;
    border-radius: var(--radius);
    font-size: 0.8em;
    font-weight: bold;
    cursor: pointer;
    font-family: monospace;
    transition: 0.2s;
}

.btn-inside-input:hover {
    color: #fff;
    border-color: #fff;
}

.btn-max {
    color: var(--primary-cyan);
    border-color: var(--border-dark);
}

.btn-max:hover {
    color: #fff;
    border-color: var(--primary-cyan);
    box-shadow: 0 0 8px var(--primary-glow);
}

/* =========================================
   Swap Form 特有の入力部品
========================================= */
.input-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 8px;
}

.input-header-row .form-label {
    margin-bottom: 0;
    font-size: 0.9em;
}

.max-amount-display {
    font-size: 0.85em;
    color: var(--text-muted);
    font-weight: bold;
    text-align: right;
}

.input-field-wrap {
    display: flex;
    gap: 10px;
}

.token-select-dropdown {
    flex: 1;
    padding: 8px;
    border-radius: var(--radius);
    border: 1px solid var(--border-dark);
    background-color: #000;
    color: #fff;
    font-size: 1em;
    outline: none;
    font-family: 'Cinzel', serif;
}

.amount-input-box {
    width: 100%;
    padding: 12px;
    padding-right: 65px;
    border-radius: var(--radius);
    border: 1px solid var(--border-dark);
    background-color: rgba(0, 0, 0, 0.4);
    color: var(--primary-cyan);
    font-size: 1.1em;
    outline: none;
    box-sizing: border-box;
    font-family: monospace;
    text-shadow: 0 0 5px rgba(0, 229, 255, 0.2);
}

.amount-readonly-box {
    background-color: #080d09;
    color: var(--text-muted);
    border: 1px solid var(--border-dark);
}

.btn-max-embed {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #222;
    color: var(--accent-amber);
    border: 1px solid var(--border-dark);
    padding: 5px 10px;
    border-radius: var(--radius);
    font-size: 0.8em;
    font-weight: bold;
    cursor: pointer;
    font-family: monospace;
    transition: 0.2s;
}

.btn-max-embed:hover {
    border-color: var(--accent-amber);
    box-shadow: 0 0 8px var(--amber-glow);
}

/* =========================================
   Transmutation Node (錬成陣・逆スワップボタン)
========================================= */
.transmutation-node {
    text-align: center;
    margin: -15px 0;
    position: relative;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
}

.circle-rune-bg {
    position: absolute;
    width: 52px;
    height: 52px;
    border: 1px dashed var(--border-dark);
    border-radius: 50%;
    animation: spinRune 20s linear infinite;
    pointer-events: none;
}

@keyframes spinRune {
    100% {
        transform: rotate(360deg);
    }
}

.btn-reverse {
    background: var(--card-bg);
    border: 1px solid var(--border-dark);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    transition: 0.2s;
    color: var(--primary-cyan);
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-reverse:hover {
    border-color: var(--primary-cyan);
    box-shadow: 0 0 10px var(--primary-glow);
    color: #fff;
}

/* =========================================
   Realtime Info
========================================= */
.realtime-info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 8px;
}

.info-block-text {
    font-size: 0.85em;
    color: var(--text-muted);
    font-weight: 600;
    line-height: 1.4;
    white-space: pre-wrap;
}

/* =========================================
   Buttons (Send / Swap)
========================================= */
.btn-send {
    width: 100%;
    background: transparent;
    color: var(--accent-amber);
    border: 1px solid var(--accent-amber);
    padding: 15px;
    border-radius: var(--radius);
    font-size: 1.22em;
    font-family: 'Cinzel', serif;
    letter-spacing: 2px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    box-shadow: 0 0 15px var(--amber-glow);
    transition: all 0.3s;
    text-transform: uppercase;
}

.btn-send:hover:not(:disabled) {
    background: var(--accent-amber);
    color: #000;
    box-shadow: 0 0 30px var(--amber-glow);
    transform: translateY(-1px);
}

.btn-send:disabled {
    background: #111;
    color: #444;
    border-color: #222;
    box-shadow: none;
    cursor: not-allowed;
}

.btn-swap {
    width: 100%;
    background: transparent;
    color: var(--primary-cyan);
    border: 1px solid var(--primary-cyan);
    padding: 15px;
    border-radius: var(--radius);
    font-size: 1.22em;
    font-family: 'Cinzel', serif;
    letter-spacing: 2px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    box-shadow: 0 0 15px var(--primary-glow);
    transition: all 0.3s;
    text-transform: uppercase;
}

.btn-swap:hover:not(:disabled) {
    background: var(--primary-cyan);
    color: #000;
    box-shadow: 0 0 30px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-swap:disabled {
    background: #111;
    color: #444;
    border-color: #222;
    box-shadow: none;
    cursor: not-allowed;
}

/* プログラムからの安全なスタイル切り替え用（エラー状態の枠と文字） */
.btn-error-state {
    color: var(--danger) !important;
    border-color: var(--danger) !important;
}

/* =========================================
   Liquidity Monitor (Console)
========================================= */
.server-status-row {
    font-size: 0.8em;
    color: var(--text-muted);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: monospace;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #555;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
    transition: background-color 0.3s;
}

/* JS切り替え用のステータスクラス */
.status-dot.connected {
    background-color: var(--primary-cyan);
}

.status-dot.starting {
    background-color: var(--accent-amber);
}

.monitor-header-row {
    display: flex;
    justify-content: space-between;
    gap: 5px;
    align-items: center;
    margin-top: 30px;
    margin-bottom: 8px;
}

.monitor-dots-wrap {
    display: flex;
    gap: 5px;
}

.monitor-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.monitor-dot.dot-red {
    background: #ff5f56;
}

.monitor-dot.dot-yellow {
    background: #ffbd2e;
}

.monitor-dot.dot-green {
    background: #27c93f;
}

.monitor-title-text {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-main);
}

.console-log-box {
    background: #050806;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    padding: 15px;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9);
}

.console-scroll-area {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #d4d4d4;
    min-height: 100px;
    max-height: 250px;
    overflow-y: auto;
}

.console-legend {
    margin-top: 10px;
    text-align: center;
    font-family: 'Consolas', monospace;
    font-size: 0.85rem;
    font-weight: bold;
    color: #fff;
    border-top: 1px dashed var(--border-dark);
    padding-top: 8px;
}

.log-line {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    white-space: nowrap;
}

.log-time {
    color: #666;
    width: 85px;
}

.log-symbol {
    color: #fff;
    width: 60px;
    font-weight: bold;
    font-family: 'Cinzel', serif;
}

.log-status {
    font-weight: bold;
}

.log-status.true {
    color: var(--primary-cyan);
    text-shadow: 0 0 5px var(--primary-glow);
}

.log-status.false {
    color: var(--danger);
    text-shadow: 0 0 5px var(--danger-glow);
}

.log-balance {
    color: var(--success);
    text-align: right;
    font-weight: bold;
}

/* =========================================
   History
========================================= */
.history-section {
    margin-top: 40px;
}

.history-header-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.history-title-clickable {
    font-weight: bold;
    font-size: 1.5em;
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.2s;
    color: #fff;
}

.history-title-clickable:hover {
    color: var(--primary-cyan);
    text-shadow: 0 0 5px var(--primary-glow);
}

.history-btn-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-console-refresh {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-cyan);
    font-size: 1.5rem;
    padding: 0;
    line-height: 1;
    vertical-align: middle;
    transition: transform 0.2s;
}

.btn-console-refresh:hover {
    transform: rotate(90deg);
}

.btn-resethistory {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 5px 12px;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    font-family: monospace;
}

.btn-resethistory:hover {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 0 8px var(--danger-glow);
}

/* =========================================
   Misc & Utilities (JS用クラスなど)
========================================= */
.alert-non-evm {
    text-align: center;
    font-size: 0.85rem;
    color: var(--danger);
    margin-top: 0px;
    margin-bottom: 12px;
    font-weight: bold;
    opacity: 0.9;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 5px var(--danger-glow);
}

.empty-text {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
}

.loading-subtext {
    font-size: 0.8em;
    color: #888;
}

.empty-error-text {
    color: var(--danger);
    font-weight: bold;
    text-align: center;
    padding: 20px;
}

.chart-custom-tooltip {
    position: absolute;
    background: rgba(11, 16, 13, 0.95);
    color: var(--primary-cyan);
    border: 1px solid var(--border-dark);
    padding: 12px;
    border-radius: var(--radius);
    pointer-events: none;
    font-size: 15px;
    font-weight: bold;
    transform: translate(-50%, -100%);
    transition: opacity 0.2s;
    opacity: 0;
    z-index: 1000;
    white-space: pre;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.chart-custom-tooltip.active {
    opacity: 1;
}

/* プログラムからの文字色変更用クラス */
.text-danger {
    color: var(--danger);
}

.text-amber {
    color: var(--accent-amber);
}

.text-muted {
    color: var(--text-muted);
}

/* CSP対策：display: inline とエラー色を組み合わせたクラス */
.inline-error {
    display: inline;
    color: var(--danger);
    font-weight: bold;
    text-shadow: 0 0 5px var(--danger-glow);
}

/* レイアウト調整用ユーティリティ */
.mt-15 {
    margin-top: 15px;
}

.mb-5 {
    margin-bottom: 5px;
}

.p-15 {
    padding: 15px;
}

/* ログ行のレイアウト用 */
.console-log-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.console-log-left {
    display: flex;
    align-items: center;
}

.console-symbol {
    display: inline-block;
    width: 65px;
}

.console-status-text {
    color: #888;
    font-size: 0.9em;
    font-family: 'Consolas', monospace;
}

.console-log-right {
    padding-right: 15px;
}

/* =========================================
   Faucet 専用追加クラス (完全復元版)
========================================= */

/* --- Container & Layout --- */
.faucet-container {
    width: 100%;
    max-width: 650px;
    margin: 40px auto 40px auto;
    /* ★修正：上下の余白と、左右の中央揃えを完全に復元 */
    padding: 0 20px;
    /* ★修正：画面が狭い時の左右の余白を復元 */
    box-sizing: border-box;
}

/* --- Typography --- */
.faucet-header {
    text-align: center;
    margin-top: 25px;
    margin-bottom: 30px;
}

.faucet-section-title {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
    color: #fff;
}

/* --- Card & Background --- */
.faucet-card {
    background-color: var(--card-bg);
    background-image:
        radial-gradient(circle at center, rgba(0, 229, 255, 0.05) 0%, transparent 60%),
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='50' cy='50' r='40' fill='none' stroke='%2300e5ff' stroke-width='1' stroke-dasharray='5 5' opacity='0.1'/%3E%3Ccircle cx='50' cy='50' r='30' fill='none' stroke='%2300e5ff' stroke-width='0.5' opacity='0.05'/%3E%3C/svg%3E");
    background-position: center 20%;
    background-repeat: no-repeat;
    background-size: 150%;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8), 0 4px 10px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
    position: relative;
}

.faucet-card-header {
    text-align: right;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-dark);
}

/* --- Token List & Items --- */
.faucet-token-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}

.faucet-token-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-dark);
    border-left: 4px solid var(--primary-cyan);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.faucet-token-item:hover:not(.disabled) {
    border-color: var(--primary-cyan);
    background-color: rgba(0, 229, 255, 0.05);
}

.faucet-token-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: rgba(255, 68, 68, 0.05);
    border-left-color: var(--danger);
}

.faucet-token-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 15px;
    accent-color: var(--primary-cyan);
    cursor: pointer;
}

.faucet-token-info {
    flex-grow: 1;
    margin-top: -5px;
    margin-bottom: -5px;
}

.faucet-token-symbol {
    font-size: 16px;
    font-weight: bold;
    display: block;
    color: var(--text-main);
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
}

.faucet-token-address-hint {
    font-size: 12px;
    font-weight: normal;
    color: var(--text-muted);
    font-family: monospace;
}

.faucet-token-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* --- Buttons (Faucet独自の上書き設定) --- */
.faucet-btn-primary {
    width: 100%;
    font-family: 'Cinzel', serif;
    font-size: 1.2em;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* --- Misc (Faucet専用のヒント欄) --- */
.faucet-manual-import-hint {
    margin-top: 25px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-dark);
    border-radius: var(--radius);
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    font-family: 'Courier New', monospace;
}

.faucet-manual-import-hint a {
    color: var(--primary-cyan);
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
}

.faucet-manual-import-hint a:hover {
    color: #fff;
    text-shadow: 0 0 8px var(--primary-glow);
}

/* =========================================
   ★追加：Summary Box Elements (サマリーボックスの完全復元)
========================================= */
.faucet-summary-box {
    background: rgba(0, 0, 0, 0.6);
    border-radius: var(--radius);
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid var(--border-dark);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.faucet-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.faucet-summary-value {
    font-weight: bold;
    color: var(--primary-cyan);
    font-size: 1.1em;
}

.faucet-summary-divider {
    border-top: 1px dashed var(--border-dark);
    padding-top: 12px;
    margin-top: 12px;
}

.faucet-summary-desc {
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--text-muted);
}

.faucet-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-dark);
    border-radius: 4px;
}

.faucet-summary-item-symbol {
    font-weight: bold;
    color: var(--text-main);
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
}

.faucet-summary-item-amount {
    font-family: monospace;
    font-size: 15px;
    color: var(--primary-cyan);
    text-shadow: 0 0 5px var(--primary-glow);
}

.faucet-summary-amount-wrap {
    width: 100%;
}

/* =========================================
   Migration 専用追加クラス (完全継承版)
========================================= */

/* --- Container & Layout --- */
.migration-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 650px;
    border: 1px solid var(--border-dark);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.9), 0 10px 30px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
    position: relative;
    margin: 40px auto;
    /* bodyのpadding代わりの中央配置用余白 */
}

.migration-subtitle {
    text-align: center;
    color: var(--text-main);
    font-size: 0.95em;
    font-weight: bold;
    margin-bottom: 25px;
    line-height: 1.6;
    font-family: 'Courier New', monospace;
}

.migration-subtitle-jp {
    font-size: 0.85em;
    font-weight: normal;
    color: var(--text-muted);
    font-family: 'Noto Serif JP', serif;
}

/* --- Warning Box (Unlisted Elements) --- */
.migration-warning-box {
    background: rgba(255, 68, 68, 0.05);
    border: 1px solid var(--danger);
    border-left: 4px solid var(--danger);
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 25px;
    font-size: 0.9em;
    line-height: 1.6;
    color: var(--danger);
    box-shadow: inset 0 0 10px rgba(255, 68, 68, 0.1);
    font-family: 'Courier New', monospace;
}

.migration-warning-jp {
    display: block;
    margin-top: 8px;
    font-size: 0.85em;
    font-family: 'Noto Serif JP', serif;
}

.migration-hub-link {
    color: var(--primary-cyan);
    font-weight: bold;
    text-decoration: underline;
    transition: 0.3s;
}

.migration-hub-link:hover {
    color: #fff;
    text-shadow: 0 0 8px var(--primary-glow);
}

/* --- Info Box --- */
.migration-info-box {
    background: rgba(230, 171, 8, 0.05);
    border: 1px solid var(--accent-amber);
    border-left: 4px solid var(--accent-amber);
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 30px;
    font-size: 0.9em;
    line-height: 1.6;
    color: var(--text-main);
    box-shadow: inset 0 0 10px rgba(230, 171, 8, 0.1);
}

.migration-info-box-title {
    color: var(--accent-amber);
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 5px;
    display: block;
}

.migration-info-box-jp {
    font-size: 0.85em;
    color: var(--text-muted);
    font-family: 'Noto Serif JP', serif;
    display: block;
    margin-bottom: 8px;
}

.migration-info-box-link {
    color: var(--primary-cyan);
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    margin-top: 5px;
    transition: 0.3s;
}

.migration-info-box-link:hover {
    color: #fff;
    text-shadow: 0 0 8px var(--primary-glow);
}

.migration-info-subtext {
    font-size: 0.85em;
    color: var(--text-muted);
}

/* --- Inputs --- */
.migration-input-group {
    margin-bottom: 25px;
}

.migration-input-label {
    display: block;
    margin-bottom: 8px;
    font-size: 1em;
    font-weight: bold;
    color: var(--text-muted);
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
}

.migration-input-text {
    width: 100%;
    padding: 15px;
    border-radius: var(--radius);
    border: 1px solid var(--border-dark);
    background: #050505;
    color: #fff;
    font-family: monospace;
    font-size: 1.1em;
    box-sizing: border-box;
    outline: none;
    transition: 0.3s;
}

.migration-input-text:focus {
    border-color: var(--primary-cyan);
    box-shadow: 0 0 8px var(--primary-glow);
}

.migration-input-text::placeholder {
    color: #444;
}

.migration-error-msg {
    color: var(--danger);
    font-size: 0.85em;
    font-weight: bold;
    margin-top: 8px;
    min-height: 1.2em;
    white-space: pre-line;
    text-shadow: 0 0 5px var(--danger-glow);
}

.migration-btn-autofill {
    background: transparent;
    border: 1px solid #666;
    color: var(--text-main);
    padding: 10px 15px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
    font-size: 0.85em;
    font-family: 'Courier New', monospace;
}

.migration-btn-autofill:hover {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
    background: rgba(0, 229, 255, 0.05);
}

/* --- Asset List --- */
.migration-asset-list {
    background: #050505;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    padding: 15px;
    margin-bottom: 25px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 1);
}

.migration-asset-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #111;
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 5px;
    border-radius: 4px;
}

.migration-asset-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.migration-asset-symbol {
    font-weight: bold;
    font-size: 1.1em;
    color: var(--primary-cyan);
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
}

.migration-asset-amount {
    color: #fff;
    font-weight: bold;
    font-size: 1.1em;
    font-family: monospace;
}

/* --- Main Action Button --- */
.migration-btn-transfer {
    background: transparent;
    color: var(--primary-cyan);
    border: 1px solid var(--primary-cyan);
    padding: 18px;
    width: 100%;
    border-radius: var(--radius);
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
    font-family: 'Cinzel', serif;
    letter-spacing: 2px;
    text-transform: uppercase;
    box-shadow: 0 0 15px var(--primary-glow);
}

.migration-btn-transfer:disabled {
    background: #111;
    color: #444;
    border-color: #222;
    cursor: not-allowed;
    box-shadow: none;
}

.migration-btn-transfer:hover:not(:disabled) {
    background: var(--primary-cyan);
    color: #000;
    box-shadow: 0 0 30px var(--primary-glow);
    transform: translateY(-2px);
}

/* JSで通信エラー時にボタンを赤くするための専用シール */
.migration-btn-error-state {
    color: var(--danger) !important;
    border-color: var(--danger) !important;
}

.btn-modal-return {
    margin-top: 20px;
    padding: 12px 24px;
    background: transparent;
    color: var(--text-main);
    border: 1px solid #666;
    border-radius: var(--radius);
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
}

.btn-modal-return:hover {
    background: #333;
    color: #fff;
    border-color: #fff;
}

/* --- Modals (Overlays) --- */
.migration-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(8px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-direction: column;
    color: #fff;
}

.migration-modal-box {
    background: var(--card-bg);
    padding: 40px;
    border-radius: var(--radius);
    border: 1px solid var(--border-dark);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(0, 0, 0, 0.9);
    max-width: 500px;
    width: 90%;
}

.migration-error-modal-box {
    border-color: var(--danger);
    border-left: 4px solid var(--danger);
    box-shadow: 0 0 30px var(--danger-glow);
}

.migration-large-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px dashed var(--primary-cyan);
    border-radius: 50%;
    animation: spin 3s linear infinite;
    margin-bottom: 20px;
}

.migration-small-spinner {
    width: 20px;
    height: 20px;
    margin-bottom: 0;
    vertical-align: middle;
    border-width: 2px;
}

.migration-progress-text {
    color: var(--primary-cyan);
    font-size: 1.2em;
    font-weight: bold;
    white-space: pre-line;
    font-family: monospace;
    line-height: 1.5;
    text-shadow: 0 0 10px var(--primary-glow);
}

.migration-error-title {
    color: var(--danger);
    margin-top: 0;
    font-weight: 800;
    font-family: 'Cinzel', serif;
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--danger-glow);
}

.migration-error-desc {
    font-weight: bold;
    color: var(--text-muted);
    line-height: 1.6;
    font-family: monospace;
}

.migration-error-desc-jp {
    font-size: 0.9em;
    font-family: 'Noto Serif JP', serif;
}

.migration-status-text {
    text-align: center;
    color: #555;
    padding: 20px;
    font-weight: bold;
    font-family: monospace;
}

.migration-error-status-text {
    color: var(--danger);
    font-weight: bold;
    text-align: center;
    padding: 20px;
    line-height: 1.5;
}