/* genesis/web-app/styles/page-forge.css */
/* 創世の錬成陣（The Genesis Forge）および記録の殿堂（The Hall of Records）専用のお洋服（CSS）です */

/* --- シリーズ表示 --- */
.forge-title-container {
    width: 100%;
    max-width: 480px;
    margin: 40px auto 0 auto;
    padding: 20px;
}

.series-display {
    text-align: center;
    color: var(--accent-amber);
    font-family: 'Cinzel', serif;
    font-size: 1.2em;
    letter-spacing: 2px;
    margin-bottom: 20px;
    text-shadow: 0 0 10px var(--amber-glow);
}

.series-number {
    font-weight: bold;
    font-size: 1.5em;
    text-shadow: 0 0 15px var(--accent-amber);
}

/* --- Altar (The Forge) 祭壇の箱 --- */
.altar-container {
    max-width: 700px;
    width: 100%;
    background: var(--card-bg);
    padding: 40px;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.9), 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    box-sizing: border-box;
    margin-top: 0;
}

.altar-info-title {
    font-size: 1.2em;
    color: var(--text-muted);
    margin-top: 0;
    text-align: center;
    font-family: 'Cinzel', serif;
    letter-spacing: 2px;
}

.loading-msg {
    color: var(--text-muted);
    text-align: center;
    margin-top: 40px;
    font-family: monospace;
}

/* --- 特典選択UIのスタイル（PCは横並び・スマホは縦並び） --- */
.reward-selection {
    margin-top: 10px;
    text-align: center;
    border-top: 1px dashed var(--border-dark);
    padding-top: 20px;
}

.reward-selection-title {
    font-family: 'Cinzel', serif;
    color: var(--text-main);
    letter-spacing: 1px;
    margin-bottom: 15px;
    font-size: 1.1em;
}

/* パソコンなどの広い画面では左右に並べます */
.reward-options-container {
    display: flex;
    flex-direction: row;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
}

.reward-option {
    flex: 1;
    cursor: pointer;
    position: relative;
    box-sizing: border-box;
    display: flex;
}

.reward-option input[type="radio"] {
    display: none;
}

/* カード本体：高さを背比べして同じになるように伸ばします */
.reward-card {
    width: 100%;
    border: 1px solid var(--border-dark);
    background: rgba(0, 0, 0, 0.5);
    padding: 15px 12px;
    border-radius: var(--radius);
    transition: all 0.3s ease;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.reward-card h4 {
    margin: 0 0 6px 0;
    font-family: 'Cinzel', serif;
    color: var(--text-muted);
    font-size: 1.05em;
    letter-spacing: 1px;
}

.reward-card p {
    margin: 0;
    font-family: 'Noto Serif JP', serif;
    font-size: 0.85em;
    color: #888;
    line-height: 1.4;
}

/* 画面の幅が600px以下のスマートフォンでは、自動で上下の縦並びに切り替えます */
@media (max-width: 600px) {
    .reward-options-container {
        flex-direction: column;
        gap: 12px;
    }
}

/* 選択時の光るエフェクト */
.reward-option input[type="radio"]:checked+.reward-card {
    border-color: var(--primary-cyan);
    background: rgba(0, 229, 255, 0.05);
    box-shadow: 0 0 15px var(--primary-glow);
}

.reward-option input[type="radio"]:checked+.reward-card h4 {
    color: var(--primary-cyan);
}

.reward-option input[type="radio"]:checked+.reward-card p {
    color: var(--text-main);
}

/* --- 錬成ボタン --- */
.btn-forge {
    background: transparent;
    color: var(--primary-cyan);
    padding: 16px 20px;
    border: 1px solid var(--primary-cyan);
    border-radius: var(--radius);
    font-size: 1.15em;
    cursor: pointer;
    width: 100%;
    margin-top: 25px;
    font-family: 'Cinzel', serif;
    letter-spacing: 2px;
    transition: all 0.4s;
    text-transform: uppercase;
    box-shadow: 0 0 15px var(--primary-glow);
    white-space: normal;
    line-height: 1.4;
    word-break: break-word;
    box-sizing: border-box;
}

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

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

.allowance-setting {
    margin-top: 25px;
    font-size: 0.85em;
    color: var(--text-muted);
    text-align: center;
}

.allowance-setting input {
    cursor: pointer;
    accent-color: var(--primary-cyan);
    vertical-align: middle;
}

/* --- Fusion Core & Orbs (融合炉とエレメントの軌道) --- */
.fusion-container {
    position: relative;
    width: 320px;
    height: 320px;
    margin: 30px auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.fusion-core {
    width: 90px;
    height: 90px;
    background: radial-gradient(circle, #111 0%, #000 100%);
    border: 2px solid var(--border-dark);
    border-radius: 50%;
    z-index: 10;
    transition: all 0.5s ease;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Cinzel', serif;
    font-size: 0.8em;
    color: #555;
    text-align: center;
    line-height: 1.2;
}

.fusion-core.ready {
    border-color: var(--primary-cyan);
    background: radial-gradient(circle, rgba(0, 229, 255, 0.1) 0%, #000 100%);
    color: var(--primary-cyan);
    text-shadow: 0 0 10px var(--primary-cyan);
    box-shadow: 0 0 30px var(--primary-glow), inset 0 0 20px var(--primary-glow);
    animation: corePulse 2s infinite;
}

.fusion-core.forging {
    animation: coreHeartbeat 0.3s infinite !important;
    background: #fff !important;
    color: #000 !important;
    box-shadow: 0 0 60px #fff, inset 0 0 30px #fff !important;
    border-color: #fff !important;
}

.element-orb {
    position: absolute;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translate(-50%, -50%);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
}

.element-orb.forging {
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
}

.orb-inner {
    width: 62px;
    height: 62px;
    background: #0d0d0d;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 0.7em;
    color: #aaa;
    border: 2px solid #222;
    z-index: 2;
}

.orb-inner.ready {
    border-color: var(--primary-cyan);
    color: #fff;
    text-shadow: 0 0 5px var(--primary-cyan);
    box-shadow: inset 0 0 15px var(--primary-glow);
}

.orb-symbol {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 2px;
}

.energy-line {
    position: absolute;
    top: 50%;
    left: 50%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-glow));
    transform-origin: 0 50%;
    z-index: 1;
    animation: energyFlow 1s linear infinite;
}

@keyframes corePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 20px var(--primary-glow);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 40px rgba(0, 229, 255, 0.6);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 20px var(--primary-glow);
    }
}

@keyframes coreHeartbeat {
    0% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.15);
    }

    50% {
        transform: scale(1);
    }

    75% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes energyFlow {
    0% {
        background-position: -100px 0;
    }

    100% {
        background-position: 100px 0;
    }
}

/* --- Epic Flash & Overlay (大成功時の演出) --- */
.flash-bang {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #fff;
    z-index: 20000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 2s ease-out;
}

.flash-bang.active {
    opacity: 1;
    transition: none;
}

#epicOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle, rgba(0, 30, 30, 0.98) 0%, rgba(0, 0, 0, 1) 100%);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: #fff;
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    overflow: hidden;
    pointer-events: none;
}

#epicOverlay.active {
    display: flex;
    pointer-events: auto;
}

.epic-title {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-cyan);
    text-shadow: 0 0 20px var(--primary-cyan);
    margin-bottom: 10px;
    animation: popUp 0.8s forwards;
    font-family: 'Cinzel', serif;
}

.epic-serial {
    font-family: monospace;
    font-size: clamp(3rem, 10vw, 5rem);
    font-weight: bold;
    opacity: 0;
    margin-bottom: 30px;
    line-height: 1;
}

.epic-title.insane {
    animation: insanePulse 0.15s infinite;
    color: var(--primary-cyan);
}

.epic-serial.insane {
    animation: fadeIn 0.5s forwards, insanePulse 0.2s infinite 0.5s;
    background: linear-gradient(45deg, #00e5ff, #e6ab08, #fff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.epic-canvas-front {
    z-index: 99999 !important;
}

.explorer-btn {
    margin-top: 30px;
    padding: 12px 30px;
    background: transparent;
    color: var(--primary-cyan);
    border: 1px solid var(--primary-cyan);
    cursor: pointer;
    font-family: monospace;
    text-decoration: none;
    font-size: 1.2em;
    transition: 0.3s;
    opacity: 0;
    border-radius: var(--radius);
    white-space: nowrap;
}

.explorer-btn:hover {
    background: rgba(0, 229, 255, 0.1);
    box-shadow: 0 0 15px var(--primary-glow);
}

@keyframes popUp {
    to {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes earthquake {
    0% {
        transform: translate(1px, 1px) rotate(0deg);
    }

    10% {
        transform: translate(-1px, -2px) rotate(-1deg);
    }

    20% {
        transform: translate(-3px, 0px) rotate(1deg);
    }

    30% {
        transform: translate(3px, 2px) rotate(0deg);
    }

    40% {
        transform: translate(1px, -1px) rotate(1deg);
    }

    50% {
        transform: translate(-1px, 2px) rotate(-1deg);
    }

    60% {
        transform: translate(-3px, 1px) rotate(0deg);
    }

    70% {
        transform: translate(3px, 1px) rotate(-1deg);
    }

    80% {
        transform: translate(-1px, -1px) rotate(1deg);
    }

    90% {
        transform: translate(1px, 2px) rotate(0deg);
    }

    100% {
        transform: translate(1px, -2px) rotate(-1deg);
    }
}

.shake-crazy {
    animation: earthquake 0.3s infinite;
}

@keyframes insanePulse {
    0% {
        text-shadow: 0 0 20px var(--primary-cyan), 0 0 50px var(--primary-cyan);
        transform: scale(1);
    }

    50% {
        text-shadow: 0 0 5px var(--primary-cyan), 0 0 15px var(--primary-cyan);
        transform: scale(1.05);
        color: #fff;
    }

    100% {
        text-shadow: 0 0 20px var(--primary-cyan), 0 0 50px var(--primary-cyan);
        transform: scale(1);
    }
}

/* ====================================================
   成功画面（#epicOverlay）専用のボタンサイズ固定設定
   英語と日本語でボタンの大きさが変わるのを防ぎます
==================================================== */
#epicOverlay .explorer-link-wrapper {
    width: 100%;
    align-items: center;
}

#epicOverlay .btn-vault-access {
    width: 440px;
    max-width: 90vw;
    min-height: 84px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    padding: 12px 20px;
    letter-spacing: 2px;
}

#epicOverlay .explorer-btn {
    width: 440px;
    max-width: 90vw;
    box-sizing: border-box;
    text-align: center;
}

/* ====================================================
   深淵の記録（The Abyss Ledger）
   カード上部のタイトルと、タブ内に収まるカード本体のスタイル
==================================================== */

/* --- カード外側の見出しタイトル --- */
.abyss-header {
    font-family: 'Cinzel', serif;
    color: var(--danger);
    font-size: 1.8em;
    letter-spacing: 3px;
    margin-bottom: 25px;
    text-align: center;
    text-shadow: 0 0 15px var(--danger-glow);
    border-bottom: 1px solid var(--border-dark);
    padding-bottom: 10px;
}

body.lang-ja .abyss-header {
    font-family: 'Noto Serif JP', serif;
    letter-spacing: 1px;
}

/* --- 深淵の記録 カード本体 --- */
#abyss-ledger {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    background: rgba(10, 10, 15, 0.85);
    border: 1px solid var(--border-dark);
    border-top: 4px solid var(--danger);
    padding: 20px;
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
    font-family: 'Courier New', monospace;
}

/* --- カード内部の各要素 --- */
.ledger-item {
    margin-bottom: 15px;
}

.ledger-item:last-child {
    margin-bottom: 0;
}

.ledger-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 4px;
}

.ledger-symbol {
    color: #ffffff;
    font-weight: bold;
    font-size: 1.15em;
}

.ledger-percent {
    color: var(--danger);
    font-size: 1.1em;
    font-weight: bold;
    text-shadow: 0 0 5px var(--danger-glow);
}

.ledger-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 4px 0;
}

.ledger-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #660000, var(--danger), var(--accent-amber));
    box-shadow: 0 0 10px var(--danger-glow);
    width: 0%;
    border-radius: 4px;
    transition: width 1.5s cubic-bezier(0.1, 0, 0.2, 1);
}

.ledger-detail {
    text-align: right;
    font-size: 0.9em;
    color: #aaa;
    margin-top: 4px;
    letter-spacing: 0.5px;
    font-family: monospace;
}

.ledger-sync-msg {
    text-align: center;
    font-size: 0.85em;
    color: var(--text-muted);
}

/* --- Archive Access (ボタンを上下に並べる箱) --- */
.archive-access-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    text-align: center;
    margin-top: 30px;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

.archive-notice {
    color: var(--primary-cyan);
    font-family: monospace;
    font-size: 1.25em;
    margin-bottom: 5px;
}

.btn-vault-access {
    width: 80%;
    max-width: 480px;
    margin: 0 auto;
    background: linear-gradient(135deg, #000 0%, #111 100%);
    color: #fff;
    border: 1px solid #444;
    border-bottom: 3px solid var(--primary-cyan);
    border-radius: var(--radius);
    padding: 16px 20px;
    font-family: 'Cinzel', serif;
    font-size: 1.15em;
    font-weight: bold;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.4s;
    text-transform: uppercase;
    text-decoration: none;
    display: block;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    text-align: center;
}

.btn-vault-access:hover {
    transform: translateY(-3px);
    border-color: var(--primary-cyan);
    box-shadow: 0 15px 30px var(--primary-glow);
    color: var(--primary-cyan);
}

.vault-sub-text {
    display: block;
    font-family: 'Courier New', monospace;
    font-size: 0.7em;
    letter-spacing: 1px;
    margin-top: 10px;
    color: #aaa;
}

/* --- Eternal Ledger (永遠の記録) --- */
#eternal-ledger {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
    background: var(--card-bg);
    border-top: 1px solid var(--border-dark);
    border-radius: var(--radius);
    box-sizing: border-box;
}

.eternal-header {
    font-family: 'Cinzel', serif;
    color: var(--primary-cyan);
    font-size: 1.2em;
    letter-spacing: 3px;
    margin-bottom: 25px;
    text-align: center;
    text-shadow: 0 0 10px var(--primary-glow);
}

.ledger-entry {
    background: rgba(0, 0, 0, 0.3);
    border-left: 3px solid var(--primary-cyan);
    padding: 10px 20px;
    margin-bottom: 12px;
    transition: all 0.3s;
    font-family: 'Courier New', monospace;
}

.ledger-entry:hover {
    background: rgba(0, 229, 255, 0.05);
    transform: translateX(5px);
}

.entry-meta {
    display: flex;
    justify-content: space-between;
    font-size: 1.1em;
    color: #888;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.entry-name {
    font-family: 'Cinzel', serif;
    color: var(--primary-cyan);
    font-weight: bold;
    font-size: 1em;
    word-break: break-all;
    overflow-wrap: break-word;
}

.entry-oracle {
    color: #eee;
    font-style: italic;
    font-size: 1em;
    margin-top: 5px;
    word-break: break-all;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

.btn-show-more {
    display: block;
    width: 250px;
    margin: 30px auto 0;
    background: transparent;
    border: 1px solid var(--border-dark);
    color: var(--text-muted);
    padding: 12px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-size: 0.9em;
    transition: all 0.3s;
    text-align: center;
    border-radius: var(--radius);
    white-space: nowrap;
}

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

/* --- Gallery (遺物一覧) --- */
#gallery-section {
    width: 100%;
    max-width: 900px;
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    box-sizing: border-box;
}

.gallery-title {
    font-family: 'Cinzel', serif;
    color: var(--accent-amber);
    font-size: 1.8em;
    letter-spacing: 3px;
    margin-bottom: 30px;
    text-shadow: 0 0 15px var(--amber-glow);
    border-bottom: 1px solid var(--border-dark);
    padding-bottom: 10px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

.nft-card {
    background: var(--card-bg);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    padding: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.nft-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-cyan), var(--accent-amber));
    opacity: 0.7;
}

.nft-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-cyan);
    box-shadow: 0 10px 25px var(--primary-glow);
}

.nft-image {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 15px;
    background: #050505;
    border: 1px solid #222;
}

.nft-name {
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #fff;
    font-size: 1.15em;
    font-weight: bold;
    margin-bottom: 8px;
    word-break: break-all;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    text-align: center;
}

.nft-desc {
    font-family: 'Noto Serif JP', serif;
    color: #888;
    font-size: 0.8em;
    line-height: 1.5;
    word-break: break-all;
    white-space: pre-wrap;
    text-align: center;
}

.gallery-msg {
    color: var(--text-muted);
    grid-column: 1 / -1;
    font-family: monospace;
}

/* ====================================================
   JSで動的に作られる部品のための名札（クラス）
==================================================== */
.gas-warning-msg {
    color: var(--danger);
    font-size: 0.9em;
    font-weight: bold;
    margin-top: 10px;
    text-align: center;
    text-shadow: 0 0 5px var(--danger-glow);
    line-height: 1.5;
}

.credit-highlight {
    color: var(--accent-amber);
    font-weight: bold;
    font-size: 1.6em;
    vertical-align: middle;
}

.starmap-action-btn {
    border-bottom-color: var(--accent-amber);
}

.ledger-stat-label {
    font-size: 0.8em;
    opacity: 0.7;
}

.ledger-sync-msg {
    font-size: 0.7em;
    color: var(--text-muted);
}

.ledger-empty-msg {
    text-align: center;
    color: #888;
}

.ledger-error-msg {
    text-align: center;
    color: var(--danger);
}

.entry-author {
    font-weight: bold;
    color: var(--text-main);
}

.entry-global-badge {
    color: var(--accent-amber);
    font-size: 0.8em;
    margin-left: 10px;
    font-weight: bold;
    letter-spacing: 1px;
}

.entry-user-badge {
    color: var(--text-muted);
    font-size: 0.75em;
    margin-left: 6px;
    font-style: italic;
}

.gallery-msg.loading {
    color: var(--primary-cyan);
}

.explorer-link-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    margin-top: 20px;
}

.show-delay-1 {
    opacity: 0;
    animation: fadeIn 1s forwards 1.2s;
    margin-top: 0;
}

.show-delay-2 {
    opacity: 0;
    animation: fadeIn 1s forwards 2.2s;
    margin-top: 15px;
    text-decoration: none;
    text-align: center;
}

/* ====================================================
   ★日本語モード（body.lang-ja）専用のスタイルルール
==================================================== */
body.lang-ja .altar-info-title,
body.lang-ja .reward-selection-title,
body.lang-ja .reward-card h4,
body.lang-ja .btn-forge,
body.lang-ja .btn-vault-access,
body.lang-ja .eternal-header,
body.lang-ja .btn-show-more,
body.lang-ja .gallery-title,
body.lang-ja .series-display,
body.lang-ja .ledger-title,
body.lang-ja .entry-name,
/* 記録の殿堂用に追加 */
body.lang-ja .storage-card h3,
body.lang-ja .credit-badge,
body.lang-ja .btn-engrave {
    font-family: 'Noto Serif JP', serif;
    letter-spacing: 1px;
}

body.lang-ja .btn-forge,
body.lang-ja .btn-engrave {
    font-weight: bold;
    letter-spacing: 1.5px;
}

body.lang-ja .btn-vault-access {
    letter-spacing: 2px;
}

body.lang-ja .reward-card p {
    font-size: 0.82em;
}

/* ====================================================
   記録の殿堂（The Hall of Records）専用のスタイル
==================================================== */
.storage-container {
    width: 100%;
    max-width: 700px;
    margin: 40px auto 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.header-actions {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 30px;
}

.terminal-log {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    padding: 15px;
    height: 100px;
    overflow-y: auto;
    font-size: 0.85em;
    margin-bottom: 25px;
    width: 100%;
    box-sizing: border-box;
    color: var(--primary-cyan);
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9);
}

.log-entry {
    margin-bottom: 4px;
}

.log-time {
    color: var(--text-muted);
    margin-right: 8px;
}

.storage-card {
    background: var(--card-bg);
    border: 1px solid var(--border-dark);
    border-left: 4px solid var(--accent-amber);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.8);
    transition: 0.3s;
}

.storage-card:hover {
    border-color: rgba(230, 171, 8, 0.3);
    box-shadow: 0 10px 25px var(--amber-glow), inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.storage-card h3 {
    font-family: 'Cinzel', serif;
    color: var(--accent-amber);
    margin: 0 0 15px;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.byte-counter {
    text-align: right;
    font-size: 0.8em;
    font-family: 'Courier New', monospace;
    color: var(--text-muted);
    margin-top: 8px;
    transition: color 0.3s;
}

.byte-counter.limit-exceeded {
    color: var(--danger);
    text-shadow: 0 0 5px var(--danger-glow);
    font-weight: bold;
}

.credit-badge-wrap {
    text-align: center;
    margin: 10px 0 20px;
}

.credit-badge {
    display: inline-block;
    padding: 8px 20px;
    color: var(--accent-amber);
    font-family: 'Cinzel', serif;
    font-weight: bold;
    font-size: 1.2em;
    letter-spacing: 2px;
    border: 1px solid rgba(230, 171, 8, 0.3);
    background: rgba(230, 171, 8, 0.05);
    border-radius: var(--radius);
    box-shadow: 0 0 10px var(--amber-glow);
}

.btn-engrave {
    width: 100%;
    background: transparent;
    border: 1px solid var(--accent-amber);
    color: var(--accent-amber);
    padding: 20px;
    border-radius: var(--radius);
    font-family: 'Cinzel', serif;
    font-size: 1.3em;
    letter-spacing: 4px;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 0 20px var(--amber-glow);
    transition: all 0.4s;
    text-transform: uppercase;
    box-sizing: border-box;
    white-space: normal;
    line-height: 1.4;
    word-break: break-word;
}

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

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

/* ====================================================
   タブ切り替えコンポーネント & 画面幅700px統一設定
   （お部屋の大きさを揃え、4つの引き出しを綺麗に並べます）
==================================================== */

/* 画面全体の最大横幅を700pxに統一する外枠 */
.forge-main-wrapper {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* タイトルエリアの幅を700px枠にフィットさせます */
.forge-title-container {
    max-width: 700px;
    padding: 0;
}

/* 4つのタブボタンを包む親枠（均等に並べるスイッチ台） */
.tab-navigation {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    width: 100%;
    max-width: 700px;
    margin: 25px auto 20px auto;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    box-sizing: border-box;
}

/* 各タブボタン（スイッチ本体） */
.tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    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.9rem;
    letter-spacing: 0;
}

/* 引き出しの箱（各タブの中身） */
.tab-panel {
    width: 100%;
    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);
    }
}