/* =========================================
   FATAL HARVEST | GLOBAL STYLES (V1.1 FINAL)
   ========================================= */

:root {
    --bg-color: #050505;
    --panel-bg: #111111;
    --text-main: #e0e0e0;
    --text-dim: #888888;
    --accent-green: #00FF00;
    --error-red: #ff003c;
    --glitch-purple: #FF00FF;
    --hard-shadow: #ffffff;
}

* { box-sizing: border-box; }

body {
    margin: 0; padding: 0;
    font-family: 'VT323', monospace;
    background-color: var(--bg-color);
    color: var(--text-main);
    font-size: 18px;
    overflow-x: hidden;
}

/* レイヤー制御 */
/* === GAME LAYER 初期状態 === */
#game-layer {
  position: fixed;       /* 画面固定のオーバーレイにする */
  inset: 0;              /* top:0; right:0; bottom:0; left:0; と同じ */
  width: 100%;
  height: 100%;
  display: none;         /* 初期は非表示 */
  z-index: 1000;         /* ランディングの上に出したいので高め */
  background: #000;      /* 好きなら真っ黒背景 */
}

/* ランディングは通常の一番上レイヤー */
#landing-layer {
  position: relative;
  z-index: 10;
  min-height: 100vh;     /* 画面全体ぶんの高さは最低あるようにする */
}

/* 共通ユーティリティ */
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }
.text-green { color: var(--accent-green); }
.text-red { color: var(--error-red); }
.text-dim { color: var(--text-dim); }
.uppercase { text-transform: uppercase; }
.center-text { text-align: center; margin-bottom: 15px; }
.blink { animation: blinker 1s linear infinite; }
@keyframes blinker { 50% { opacity: 0; } }

.glitch-text {
    position: relative;
    text-shadow: 2px 0 var(--glitch-purple), -2px 0 var(--accent-green);
    animation: glitch-anim 2s infinite linear alternate-reverse;
}
@keyframes glitch-anim {
    0% { transform: translate(0,0); } 20% { transform: translate(-1px,0); }
    40% { transform: translate(1px,0); } 60% { transform: translate(0,0); }
    80% { transform: translate(-1px,1px); } 100% { transform: translate(0,0); }
}

/* ヘッダー */
.header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 0; border-bottom: 1px solid #333; margin-bottom: 40px;
}
.logo-area { font-size: 1.8rem; font-weight: bold; }
.nav-links { display: flex; gap: 30px; }
.nav-links a { color: var(--text-main); text-decoration: none; font-size: 1.2rem; }
.nav-links a:hover { color: var(--accent-green); text-decoration: underline; }

/* Ticker */
.ticker-wrap {
    width: 100%; background-color: var(--error-red); overflow: hidden; height: 30px;
    white-space: nowrap; border-bottom: 1px solid #000; margin-bottom: 40px;
}
.ticker {
    display: inline-block; padding-left: 100%; animation: ticker 20s linear infinite;
    color: black; font-weight: bold; line-height: 30px; font-size: 1.1rem;
}
.ticker__item { display: inline-block; padding: 0 2rem; }
@keyframes ticker { 0% { transform: translate3d(0, 0, 0); } 100% { transform: translate3d(-100%, 0, 0); } }

/* HERO SECTION */
.hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; margin-bottom: 60px; }
.status-tag {
    border: 1px solid var(--error-red); color: var(--error-red);
    padding: 5px 10px; display: inline-block; margin-bottom: 20px;
}
h1 { font-size: 3.5rem; line-height: 1; margin: 0 0 20px 0; font-weight: 400; }
.hero-desc {
    font-size: 1.4rem; line-height: 1.4; color: #ccc; margin-bottom: 40px;
    border-left: 2px solid var(--error-red); padding-left: 15px;
}
.hero-buttons { display: flex; gap: 20px; margin-bottom: 40px; }
.btn {
    padding: 12px 24px; font-family: inherit; font-size: 1.2rem; font-weight: bold;
    text-transform: uppercase; cursor: pointer; text-decoration: none; display: inline-block;
    transition: all 0.1s;
}
.btn-primary {
    background-color: var(--accent-green); color: black; border: 2px solid var(--accent-green);
    box-shadow: 4px 4px 0px var(--hard-shadow);
}
.btn-primary:active { box-shadow: 0px 0px 0px; transform: translate(4px, 4px); }
.btn-secondary { background: transparent; color: white; border: 2px solid white; }
.btn-secondary:hover { background: #222; }

.chain-info { display: flex; gap: 40px; border-top: 1px solid #333; padding-top: 20px; }
.info-block h4 { margin: 0 0 5px 0; font-size: 0.9rem; color: var(--text-dim); }
.info-block p { margin: 0; font-size: 1.2rem; }

/* CARD PANEL */
.card-panel {
    background-color: var(--panel-bg); border: 1px solid #333; border-left: 4px solid var(--accent-green);
    padding: 20px; margin-bottom: 20px;
}
.card-top-bar { display: flex; justify-content: space-between; margin-bottom: 10px; }
.badge { border: 1px solid #555; padding: 2px 6px; font-size: 0.8rem; }
.snapshot-box {
    height: 250px; background-color: #222; display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden; margin-top: 10px;
}
.stamp-404 {
    position: absolute; bottom: 10px; right: 10px; border: 2px solid var(--accent-green); color: var(--accent-green);
    padding: 5px 10px; font-size: 1.5rem; transform: rotate(-10deg); font-weight: bold; background: rgba(0,0,0,0.5);
}
.code-block {
    background-color: #000; border: 1px solid #333; padding: 15px;
    color: var(--accent-green); overflow-x: auto; margin: 0;
}
pre { margin: 0; }

/* =========================================
   NFT STREAM (シンプル版: 枠なし・画像のみ)
   ========================================= */

.stream-section {
    margin: 40px 0 60px 0;
    /* 上下の区切り線も不要なら border: none; にしてください */
    border-top: 1px solid #333; 
    border-bottom: 1px solid #333;
    padding: 20px 0;
    background: transparent; /* 背景色なし */
    overflow: hidden;
}

.nft-marquee-wrap { 
    width: 100%; 
    overflow: hidden; 
    /* 画像の上下に影を落として立体感を出す（お好みで） */
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.nft-marquee {
    display: flex;
    gap: 20px; /* 画像同士の間隔 */
    width: max-content;
    animation: scroll-left 40s linear infinite; /* 少しゆっくり流す */
}

.nft-marquee:hover { 
    animation-play-state: paused; 
}

@keyframes scroll-left { 
    0% { transform: translateX(0); } 
    100% { transform: translateX(-50%); } 
}

/* カード本体（枠を消す） */
.nft-card {
    width: 150px;
    height: 150px;
    background: transparent;
    border: none !important; /* 枠線強制削除 */
    padding: 0;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    box-shadow: none !important; /* 光るエフェクトも削除 */
    animation: none !important;  /* 点滅も削除 */
}

/* ホバー時に少し大きくする */
.nft-card:hover {
    transform: scale(1.1);
    z-index: 10;
}

/* 画像 */
.nft-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
    border-radius: 8px; /* 角を少し丸くする */
    image-rendering: pixelated;
    /* ほんのり光らせて「モニターの中の画像」感を出す */
    filter: drop-shadow(0 0 5px rgba(0, 255, 0, 0.3));
}

/* 不要な要素を非表示にする */
.nft-id, .rarity-badge {
    display: none !important;
}

/* SECTIONS */
.section-title { font-size: 2rem; margin-bottom: 30px; border-bottom: 1px solid #333; padding-bottom: 10px; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.utility-card { background: var(--panel-bg); border: 1px solid #333; padding: 20px; transition: 0.2s; }
.utility-card:hover { border-color: var(--accent-green); transform: translateY(-5px); }
.card-header { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 10px; letter-spacing: 2px; }
.card-title { font-size: 1.5rem; color: white; margin: 0 0 10px 0; }
.card-text { color: #aaa; line-height: 1.4; }

.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.team-card { background: #000; border: 1px dashed #333; padding: 20px; text-align: center; transition: 0.2s; }
.team-card:hover { border-color: var(--accent-green); transform: translateY(-5px); }
.avatar-box {
    width: 60px; height: 60px; background: #111; border: 1px solid var(--accent-green);
    margin: 0 auto; display: flex; align-items: center; justify-content: center; font-size: 2rem; border-radius: 50%;
}
.avatar-box.gray { filter: grayscale(100%); opacity: 0.5; border-color: #555; }
.avatar-box.text-red { border-color: var(--error-red); color: var(--error-red); }
.team-name { margin: 10px 0 5px 0; color: white; font-size: 1.2rem; }
.card-desc { font-size: 0.9rem; line-height: 1.4; margin-top: 10px; color: #888; }

/* DISCLAIMER */
.disclaimer-box {
    background: rgba(20, 0, 0, 0.6); border: 1px solid var(--error-red); padding: 20px;
    color: #ccc; margin-bottom: 60px; box-shadow: 0 0 10px rgba(255, 0, 0, 0.1);
}
.disclaimer-header { border-bottom: 1px solid #880000; padding-bottom: 10px; margin-bottom: 15px; font-weight: bold; color: var(--error-red); }

/* WHITEPAPER LAYER */
#whitepaper-layer {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.95);
    z-index: 9999; display: none; justify-content: center; align-items: flex-start;
    overflow-y: auto; padding: 40px 20px; backdrop-filter: blur(10px);
}
.wp-container {
    background: #0a0a0a; border: 1px solid var(--accent-green); max-width: 800px; width: 100%;
    box-shadow: 0 0 50px rgba(0, 255, 0, 0.1); margin-bottom: 50px;
}
.wp-header {
    background: var(--accent-green); color: black; padding: 10px 20px; font-weight: bold;
    display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0;
}
.close-btn {
    background: black; color: var(--accent-green); border: none; font-family: inherit; font-size: 1.2rem; cursor: pointer;
}
.close-btn:hover { background: var(--error-red); color: white; }
.wp-content { padding: 40px; color: #ddd; line-height: 1.6; font-size: 1.1rem; }
.wp-section { margin-bottom: 40px; }
.wp-content h2 { color: var(--accent-green); border-bottom: 1px dashed #333; padding-bottom: 10px; }
.wp-content h3 { color: #fff; margin-top: 20px; font-size: 1.2rem; }
.warning-box { border: 1px solid var(--error-red); padding: 20px; background: rgba(255, 0, 60, 0.05); }
.meta-info { color: #888; border-left: 2px solid #333; padding-left: 15px; margin-bottom: 30px; }

/* --- Math Equation Style (LaTeX風) --- */
.math-equation {
    font-family: 'Times New Roman', serif; font-size: 1.5rem;
    text-align: center; margin: 30px 0; padding: 20px;
    background: transparent; color: #e0e0e0; border: none; font-style: italic; overflow-x: auto;
}
/* 分数 */
.frac { display: inline-block; vertical-align: middle; text-align: center; margin: 0 5px; font-style: normal;}
.frac .num { display: block; border-bottom: 1px solid #e0e0e0; padding-bottom: 2px; }
.frac .den { display: block; padding-top: 2px; }
/* 変数、演算子、添字、上付き文字 */
.var { font-weight: normal; }
.op { font-family: sans-serif; font-style: normal; margin: 0 5px; }
.sub { vertical-align: sub; font-size: 0.7em; font-style: normal; margin-left: -2px; }
.sup { vertical-align: super; font-size: 0.7em; font-style: normal; margin-left: -2px; }
.text-roman { font-family: 'Times New Roman', serif; font-style: normal; }
/* 総和記号など */
.sum-symbol { font-size: 1.2em; margin-right: 5px; font-style: normal; }

/* --- GAME UI STYLES --- */
#uiPanel {
  position: absolute; top: 20px; left: 20px; width: 300px;
  background: rgba(0,0,0,0.8); border: 2px solid #00ff00; padding: 20px;
  color: #00ff00; font-family: 'VT323', monospace; z-index: 1000;
}
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.panel-header h2 { margin: 0; font-size: 24px; }
.status-text { margin-top: 10px; font-size: 14px; color: #888; text-align: center;}
.stats-container { display: flex; justify-content: space-between; margin-bottom: 20px; border-top: 1px dashed #00ff00; border-bottom: 1px dashed #00ff00; padding: 15px 0;}
.stat-box { text-align: center; }
.stat-box .label { font-size: 14px; color: #888; }
.stat-box .value { font-size: 24px; font-weight: bold; }
#fieldListContainer { max-height: 300px; overflow-y: auto; margin-bottom: 20px; padding-right: 5px; }
#fieldListContainer::-webkit-scrollbar { width: 5px; }
#fieldListContainer::-webkit-scrollbar-thumb { background: #00ff00; }

.field-item { background: rgba(0,50,0,0.3); border: 1px solid #00ff00; padding: 10px; margin-bottom: 10px; cursor: pointer; transition: 0.2s; }
.field-item:hover { background: rgba(0,100,0,0.5); }
.field-header { display: flex; justify-content: space-between; font-weight: bold; margin-bottom: 5px; }
.soil-container { display: flex; align-items: center; justify-content: space-between; font-size: 14px; margin-bottom: 5px; }
.soil-bar { flex-grow: 1; height: 8px; background: #333; margin-left: 10px; }
.soil-fill { height: 100%; transition: width 0.5s, background 0.5s; }
.field-info { display: flex; justify-content: space-between; font-size: 14px; color: #aaa; margin-bottom: 10px; }
.days-left-safe { color: #00ff00; }
.days-left-warn { color: #ffff00; }
.days-left-danger { color: #ff0000; font-weight: bold; animation: blinker 1s infinite; }
.action-row { display: flex; gap: 5px; }
.action-row button { flex: 1; padding: 5px; font-family: inherit; cursor: pointer; background: #000; border: 1px solid #00ff00; color: #00ff00; font-size: 14px; }
.action-row button:hover:not(:disabled) { background: #00ff00; color: #000; }
.action-row button:disabled { border-color: #555; color: #555; cursor: not-allowed; }
.btn-upgrade:hover:not(:disabled) { background: #00ffff !important; color: #000 !important; border-color: #00ffff !important; }

#buyFieldBtn { width: 100%; padding: 10px; font-family: inherit; font-size: 18px; cursor: pointer; background: transparent; border: 2px dashed #00ff00; color: #00ff00; transition: 0.2s; }
#buyFieldBtn:hover { background: rgba(0,255,0,0.2); }

#controlsHud { position: absolute; bottom: 20px; left: 20px; background: rgba(0,0,0,0.8); border: 1px solid #00ff00; padding: 15px; color: #00ff00; font-family: 'VT323', monospace; z-index: 1000; }
.hud-title { font-weight: bold; border-bottom: 1px dashed #00ff00; margin-bottom: 10px; }
.key-row { display: flex; justify-content: space-between; margin-bottom: 5px; }
.key { font-weight: bold; color: #fff; background: #333; padding: 0 5px; }

/* ウィジェット系 */
.system-log {
    position: fixed; bottom: 20px; right: 20px; width: 300px;
    background: rgba(0, 0, 0, 0.9); border: 1px solid var(--accent-green);
    font-size: 0.9rem; z-index: 100; box-shadow: -5px -5px 0px rgba(0, 255, 0, 0.2);
}
.log-header { background: var(--accent-green); color: black; padding: 5px 10px; font-weight: bold; }
.log-content { padding: 10px; height: 150px; overflow: hidden; color: #ccc; }
.log-content p { margin: 2px 0; }

.scanline {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.2));
    background-size: 100% 4px; z-index: 999; pointer-events: none; opacity: 0.3;
}

/* レスポンシブ */
@media (max-width: 900px) { .team-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { 
    .hero-grid { grid-template-columns: 1fr; } .card-grid { grid-template-columns: 1fr; }
    .header { flex-direction: column; gap: 20px; } .nav-links { flex-wrap: wrap; justify-content: center; }
}
@media (max-width: 600px) { .team-grid { grid-template-columns: 1fr; } }

/* --- CHAT INPUT STYLES --- */
.system-log {
    /* Ensure the log container is vertically laid out */
    display: flex;
    flex-direction: column;
}

.log-content {
    /* Allow the content area to scroll and take up available space */
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    height: 200px; /* Adjust as needed */
}

.chat-input-area {
    /* Input/Button layout */
    border-top: 1px solid #222;
    padding: 10px;
    display: flex;
    flex-shrink: 0;
}
#chat-input {
    flex-grow: 1;
    background: #000;
    border: 1px solid #444;
    color: var(--accent-green, #00ff00); /* Use the green accent color */
    padding: 8px;
    font-family: 'VT323', monospace;
    font-size: 1rem;
    margin-right: 10px;
    outline: none;
    transition: border-color 0.2s;
}
#chat-input:focus {
    border-color: var(--accent-green, #00ff00);
}
#send-btn {
    background: var(--accent-green, #00ff00);
    color: #000;
    border: none;
    padding: 8px 15px;
    font-family: 'VT323', monospace;
    cursor: pointer;
    font-weight: bold;
    letter-spacing: 1px;
    transition: background 0.2s;
}
#send-btn:hover {
    background: #00cc00;
}
#send-btn:disabled {
    background: #444;
    cursor: not-allowed;
}

/* Chat Message Styling */
.user-query {
    color: #fff;
    font-weight: bold;
    margin-bottom: 5px;
}
.cortex-response {
    color: var(--accent-green, #00ff00);
    margin-bottom: 10px;
    border-left: 2px solid #005500;
    padding-left: 8px;
}
.suggested-prompts {
    margin-top: 8px;
    font-family: 'VT323', monospace;
    font-size: 0.85rem;
    color: var(--accent-green);
}

.suggest-label {
    display: block;
    margin-bottom: 4px;
    text-transform: uppercase;
    opacity: 0.8;
    letter-spacing: 0.08em;
}

.suggest-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.suggest-btn {
    border: 1px solid var(--accent-green);
    background: transparent;
    color: var(--accent-green);
    padding: 4px 8px;
    font-family: 'VT323', monospace;
    font-size: 0.75rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.suggest-btn:hover {
    background: rgba(0, 255, 128, 0.08);
}
