:root {
    --lime: #a3ff00;
    --lime-dim: #2d381a;
    --dark: #050605;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 外側の背景画像 */
body {
    background-color: #010202;
    background-image: url('bg-outer.png'); 
    background-size: cover;
    background-position: center;
    color: #b0b5c5;
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* モーダル（拡大表示）のスタイル */
#modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#modal-box {
    background: #050805;
    border: 2px solid var(--lime);
    width: 85%;
    max-width: 700px;
    padding: 25px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 0 30px rgba(163, 255, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#modal-title {
    color: var(--lime);
    border-bottom: 1px dashed var(--lime-dim);
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 18px;
}

#modal-body {
    color: #d1d5e0;
    font-size: 16px;
    line-height: 1.8;
}

.modal-profile-flex {
    display: flex;
    gap: 20px;
}
.modal-avatar-area {
    width: 140px;
    height: 180px;
    border: 1px solid var(--lime-dim);
    background: #000;
    flex-shrink: 0;
}
.modal-avatar-area img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.modal-info-area {
    flex: 1;
}

#modal-close {
    position: absolute;
    top: 10px; right: 10px;
    background: none; border: 1px solid var(--lime);
    color: var(--lime);
    width: 30px; height: 30px;
    font-size: 20px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    z-index: 1010;
}
#modal-close:hover {
    background: var(--lime); color: #000;
}

/* -------------------------------------
   ここから：タブレットの外枠と画面の設定
-------------------------------------- */
.tablet-device {
    width: 98vw;
    max-width: 1600px;
    height: 96vh;
    position: relative;
    display: flex;
    flex-direction: column;
    /* 🔴重要🔴 ご自身で作った枠（frame.png）の「太さ」に合わせてここの数字を調整してください！
       枠が太くて画面内の文字に被ってしまう場合は、この数字(45px)を大きくします。 */
    padding: 45px; 
}

/* ご自身で作った枠（frame.png）を最前面にかぶせる指定 */
.tablet-device::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('frame.png');
    background-size: 100% 100%; /* 画像を枠いっぱいに広げる */
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none; /* 画像がクリックの邪魔をしないようにする */
    z-index: 100;
}

/* タブレット画面内 */
.tablet-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 18px;
    background-color: #080a08;
    background-image: url('bg-inner.png'); 
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    /* 自作枠の内側の丸みに合わせて角を丸くします */
    border-radius: 12px; 
    z-index: 0;
}

/* 🔴背景画像を暗くするフィルター（数値を0.1〜0.3まで下げて明るくしました！）🔴 */
.tablet-screen::before {
    content: ''; position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.2); /* 0.2は20%の暗さ。背景画像がかなりクッキリ見えます */
    z-index: -1;
}
/* ------------------------------------- */

.system-header, .grid-container {
    position: relative; z-index: 1;
}

/* 起動画面 */
#boot-screen {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #000;
    z-index: 110; 
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.boot-container {
    width: 80%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#boot-logo {
    width: 150px; height: 150px;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 1.5s ease, transform 1.5s ease;
    transform: scale(0.8);
    margin-bottom: 30px;
    box-shadow: 0 0 20px rgba(163, 255, 0, 0.3);
}

#boot-terminal {
    width: 100%;
    font-family: 'Courier New', monospace;
    color: var(--lime);
    font-size: 16px;
    min-height: 200px;
}

.success-text { color: var(--lime); font-weight: bold; }
.typing-boot { margin: 5px 0; }

/* ヘッダー */
.system-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 2px solid var(--lime);
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.caution-tape {
    width: 120px; height: 6px;
    background: repeating-linear-gradient(45deg, var(--lime), var(--lime) 8px, #000 8px, #000 16px);
}

.logo {
    color: var(--lime); font-weight: bold; font-size: 22px;
    letter-spacing: 1.5px; text-shadow: 0 0 8px rgba(163, 255, 0, 0.3);
}

.status-indicator {
    display: flex; align-items: center; color: var(--lime);
    font-weight: bold; font-size: 13px; border: 1px solid var(--lime);
    padding: 4px 10px; background: rgba(0,0,0,0.6);
}

.pulse-dot {
    width: 10px; height: 10px; background-color: var(--lime);
    margin-right: 8px; border-radius: 50%; box-shadow: 0 0 6px var(--lime);
    animation: pulse 1.5s infinite linear;
}

/* グリッドレイアウト */
.grid-container {
    display: grid;
    grid-template-columns: 1.2fr 1.3fr 1.1fr;
    gap: 12px;
    flex: 1;
    min-height: 0;
}

.column {
    display: flex; flex-direction: column; gap: 12px;
    min-height: 0;
}

/* カード基本スタイル */
.card {
    background-color: rgba(5, 8, 5, 0.8); 
    border: 1px solid var(--lime);
    border-radius: 4px;
    padding: 16px;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    box-shadow: inset 0 0 10px rgba(163,255,0,0.05);
}

.card::before, .card::after {
    content: ''; position: absolute; width: 10px; height: 10px;
    border: 2px solid var(--lime); pointer-events: none;
}
.card::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.card::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.card-title {
    color: #000; background-color: var(--lime);
    display: inline-block; align-self: flex-start;
    font-size: 14px; font-weight: bold; padding: 4px 12px;
    margin-top: -26px; margin-bottom: 12px; letter-spacing: 0.5px;
    clip-path: polygon(0 0, 100% 0, 92% 100%, 0% 100%);
}

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

.clickable-card, .clickable-log, .file-item {
    cursor: pointer;
    transition: all 0.2s;
}
.clickable-card:hover {
    box-shadow: 0 0 15px rgba(163, 255, 0, 0.2);
    transform: translateY(-2px);
    border-color: #fff;
}
.clickable-log:hover, .file-item:hover {
    background: rgba(163, 255, 0, 0.1);
    border-color: var(--lime);
}

/* プロフィール */
.profile-card { flex: 2; }
.flex-profile { display: flex; gap: 16px; }
.avatar-area {
    width: 120px; height: 150px; border: 1px solid var(--lime-dim);
    background: #000; display: flex; justify-content: center; align-items: center; overflow: hidden;
    flex-shrink: 0;
}
.avatar-img { width: 100%; height: 100%; object-fit: contain; }
.info-area { flex: 1; }
.info-area h3 { color: #fff; margin-bottom: 8px; font-size: 18px; border-bottom: 1px dashed var(--lime-dim); padding-bottom: 4px; }
.label { color: var(--lime); font-weight: bold; margin-right: 4px; }
.desc { margin-top: 10px; color: #a0a5b5; font-size: 13px; }

/* ファイル */
.file-card { flex: 1; }
.file-item {
    display: flex; align-items: center; gap: 10px;
    background: rgba(0,0,0,0.5); padding: 10px;
    border: 1px solid var(--lime-dim); margin-bottom: 8px; border-radius: 4px;
}
.file-item.error { border-color: #5a1a1a; color: #ff5555; }
.file-item.error:hover { background: rgba(255, 85, 85, 0.1); border-color: #ff5555; }
.file-icon { font-size: 18px; }

/* 業務ログ */
.log-card { flex: 2.2; }
.log-list { display: flex; flex-direction: column; gap: 12px; }
.log-entry {
    background: rgba(0,0,0,0.4); padding: 12px;
    border-left: 3px solid var(--lime); border-radius: 0 4px 4px 0;
}
.log-header { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.log-tag.resolved { color: var(--lime); font-weight: bold; }
.log-tag.corrupted { color: #ff5555; font-weight: bold; }
.log-date { color: #8990a2; font-family: monospace; }
.log-text { color: #e1e5f0; font-size: 14px; }

/* リンクボタン */
.links-card { flex: 1; }
.link-buttons { display: flex; flex-direction: column; gap: 12px; }
.ui-button {
    display: flex; justify-content: space-between; align-items: center;
    background: #000; border: 1px solid var(--lime); padding: 12px 16px;
    color: var(--lime); text-decoration: none; font-weight: bold; border-radius: 4px; transition: all 0.2s;
}
.ui-button:hover { background: var(--lime); color: #000; }
.btn-sub { font-size: 12px; font-weight: normal; color: #7a8299; }
.ui-button:hover .btn-sub { color: #333; }

/* ターミナル */
.terminal-card { grid-row: span 2; }
.terminal-wrapper {
    display: flex; flex-direction: column; height: 100%;
    background: rgba(0,0,0,0.8); border: 1px solid var(--lime-dim); padding: 12px;
    min-height: 0;
}
#terminal-output {
    flex: 1; 
    overflow-y: auto; 
    font-family: 'Courier New', monospace; 
    font-size: 14px; 
    color: #a0a5b5; 
    margin-bottom: 10px;
    min-height: 0;
}
.system-msg { color: #62687a; margin-bottom: 4px;}
.output-success { color: var(--lime); margin-bottom: 4px; font-weight: bold; }
.output-error { color: #ff3366; margin-bottom: 4px;}
.output-line { margin-top: 4px; word-break: break-all; }

.terminal-input-line {
    display: flex; align-items: center; padding-top: 10px; border-top: 1px dashed var(--lime-dim);
    flex-shrink: 0;
}
.prompt { color: var(--lime); font-family: 'Courier New', monospace; font-weight: bold; margin-right: 10px; }
#cmd-input {
    flex: 1; background: none; border: none; color: #fff; font-size: 15px; font-family: 'Courier New', monospace; outline: none;
}

/* スクロールバー */
.card-content::-webkit-scrollbar, #terminal-output::-webkit-scrollbar { width: 6px; }
.card-content::-webkit-scrollbar-track, #terminal-output::-webkit-scrollbar-track { background: transparent; }
.card-content::-webkit-scrollbar-thumb, #terminal-output::-webkit-scrollbar-thumb { background: var(--lime-dim); border-radius: 3px; }
.card-content::-webkit-scrollbar-thumb:hover, #terminal-output::-webkit-scrollbar-thumb:hover { background: var(--lime); }

/* プロフィールの大枠調整 */
.profile-card { flex: 3; } 

.flex-profile { display: flex; gap: 24px; align-items: flex-start; }

/* 1. 外側の枠を大きくする */
.avatar-area-large {
    width: 200px; /* 横幅 */
    height: 250px; /* 縦幅 */
    border: 1px solid var(--lime);
    background: #000;
    flex-shrink: 0;
    display: flex;       /* 中央寄せ用 */
    justify-content: center;
    align-items: center;
}

/* 2. 中身の画像も枠いっぱいに広げる */
.avatar-img {
    width: 100%;      /* 枠の幅いっぱいに */
    height: 100%;     /* 枠の高さっぱいに */
    object-fit: cover; /* 画像を枠に合わせていい感じにトリミング（containだと余白ができる場合があるためcover推奨） */
    object-position: top; /* 顔が切れる場合は top / center / bottom で調整 */
}

.info-area-large { flex: 1; }

.skill-tag {
    display: inline-block;
    background: var(--lime-dim);
    color: var(--lime);
    font-size: 11px;
    padding: 2px 8px;
    margin: 2px;
    border: 1px solid var(--lime);
}

.desc-note {
    margin-top: 15px;
    font-size: 12px;
    color: var(--lime);
    font-style: italic;
}