/*html-------------------------------------------------------------------*/

/* マウスカーソル */

/* ベース */
html,
body,
* {
  cursor: url("../images/plusCursor.png") 16 16, auto;
}

/* クリックできるもの リンク / ボタン / サイドメニュー類 */
a,
button,
[role="button"],
.menu-toggle,
.side-menu__close,
.side-link,
.opennewtab a,
.scroll-top-btn {
  cursor: url("../images/arrowCursor.png") 0 0, pointer;
}

/* テキスト メモ帳 textarea*/
textarea,
input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
[contenteditable="true"] {
  cursor: url("../images/textarea.png") 8 16, text;
}

/* 描画（十字）DrawingToolのcanvas */
#drawingCanvas,
canvas {
  cursor: url("../images/drawing.png") 16 16, crosshair;
}

/* 移動window のヘッダーを掴む所 */
.window-header {
  cursor: url("../images/plusCursor.png") 16 16, move;
}

/* リサイズ：右下を掴む（あなたの実装が .resizer ならこれでOK）
   - もし .resizer が無い場合は、JSで付けてるクラス名に合わせてください */
.resizer,
.resize-handle,
.window-resizer {
  cursor: url("../images/plusCursor.png") 16 16, se-resize;
  /*---------------aaaaaaaa*/
}

/* ドラッグ&ドロップ系 ファイル入力（画像/音/動画アップロード） */
input[type="file"],
#image-upload,
#fileInput,
.js-video-file {
  cursor: url("../images/plusCursor.png") 16 16, copy;
}

/* スライダー 線の太さ（range） */
input[type="range"],
#lineWidth {
  cursor: url("../images/slider.png") 16 16, ew-resize;
}

/* チェックボックス ループ等 */
input[type="checkbox"] {
  cursor: url("../images/arrowCursor.png") 0 0, pointer;
}

/* 無効（disabled なボタン等） */
button:disabled,
.disabled,
[disabled] {
  cursor: url("../images/notallowed.png") 16 16, not-allowed;
  /*未設定*/
}

/* “処理中” を出したい時用（JSで body に .is-loading を付ける想定） */
body.is-loading,
body.is-loading * {
  cursor: url("../images/wait.png") 16 16, wait;
  /*未設定*/
}

/*body-----------------------------------------------------------------------------*/
body {
  min-height: 1900px;
  /*ここでbodyの高さを調整*/
  background-color: #1f1f1f;
  /* 背景を黒に */
  color: #FADAC1;
  /*テキストカラー*/
  font-family: 'Consolas', monospace;
  /* モノスペースフォントでデジタル感 */
  font-size: 1rem;
  margin: 0;
  text-align: center;
  overflow-x: hidden;
}


/*header-------------------------------------------------------------------*/
header {
  background-color: #50A3AB;
  /*背景色*/
  box-shadow: 0 2px 4px #FADAC1;
  /*さりげない影で立体感を出す*/
  width: 100%;
  position: sticky;
  /*スクロールしても常に上部に留まる*/
  top: 0;
  z-index: 1000;
  /*他の要素より手前に表示*/
  padding-top: 6px;
}

/*ヘッダーの中身（横並びにするためのコンテナ）*/
.header-container {
  display: flex;
  /*Flexboxを有効化*/
  justify-content: space-between;
  /*要素を左右に広げる*/
  align-items: center;
  /*要素を垂直方向で中央に揃える*/
  margin: 0 auto;
  padding: 10px 10px;
}

/*ハンバーガーボタン関係---------------------------------*/

.menu-toggle {
  border: 1px solid #FADAC1;
  background: #1D313C;
  color: #FADAC1;
  box-shadow: 0 0 10px #FADAC1;
  border-radius: 10px;
  width: 42px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 12px;
  transition: filter 0.15s, transform 0.06s;
}

.menu-toggle:hover {
  filter: brightness(1.15);
}

.menu-toggle:active {
  transform: translateY(1px);
}

/*ロゴのスタイリング*/

.header-container img {
  width: 2.5em;
  height: 2.5em;
  transition: transform 0.15s ease;
}

.header-container img:hover {
  transform: scale(1.5);
  /*少し拡大*/
  cursor: none;
  /*カーソルを非表示*/
}

.header-container p {
  font-size: 1.5em;
  font-weight: 900;
  color: #F6723A;
  -webkit-text-stroke: 0.5px #FADAC1;
  text-decoration: none;
  /* 下線を削除 */
  margin: 0;
}

/* ハンバーガーの3本線 */
.menu-icon {
  width: 20px;
  height: 2px;
  background: currentColor;
  position: relative;
  display: block;
}

.menu-icon::before,
.menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: currentColor;
}

.menu-icon::before {
  top: -6px;
}

.menu-icon::after {
  top: 6px;
}

.header-container {
  align-items: center;
}

/*伝言掲示板（流れる帯）----------------------------------------------*/
.ticker {
  border-top: 1px solid #1f1f1f;
  border-bottom: 1px solid #1f1f1f;
  background: #1f1f1f;
  color: #FADAC1;
  box-shadow: 0 0 10px #FADAC1;
}

.ticker__viewport {
  overflow: hidden;
  width: 100%;
}

.ticker__track {
  display: flex;
  width: max-content;
  gap: 0;
  white-space: nowrap;
  will-change: transform;
  animation: ticker-move 80s linear infinite;
}

.ticker__item {
  display: inline-block;
  padding: 8px 0;
  font-size: 14px;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px #FADAC1;
}

/*左へ流す*/
@keyframes ticker-move {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }

  /*2回並べた半分ぶん*/
}

/*動きが苦手な人ブラウザ設定に従うようにできる*/
@media (prefers-reduced-motion: reduce) {
  .ticker__track {
    animation: none;
  }
}

/*staricon---------------------------------------------------------------*/

.staricon {

  /* ウィンドウ全体のスタイル */
  .star-window {
    width: 380px;
    height: 340px;
    background-color: #222;
    border: 2px solid #50A3AB;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  }

  /* ウィンドウの中身（ここがアートの舞台になります） */
  .star-window-content {
    flex: 1;
    position: relative;
    /* 内部要素の基準点 */
    background-color: #1D313C;
    overflow: hidden;
    /* はみ出し防止 */
    display: flex;
    justify-content: center;
    align-items: center;
  }

  /*----------------------------*/
  /* 宇宙アートの各パーツ */
  .stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(white, rgba(255, 255, 255, .2) 1px, transparent 40px);
    background-size: 50px 50px;
    opacity: 0.3;
    animation: stars-move 100s linear infinite;
  }

  .space-art {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    filter: contrast(1.1) saturate(1.2);
    z-index: 2;
  }

  .planet {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: repeating-linear-gradient(#F6723A, #F6723A 6px, #C43B39 6px, #C43B39 12px);
    box-shadow: inset -10px -10px 30px rgba(0, 0, 0, 0.5), 0 0 20px #F6723A;
    animation: planet-pulse 4s ease-in-out infinite;
  }

  .orbit {
    position: absolute;
    border: 1.5px solid #50A3AB;
    border-radius: 50%;
    opacity: 0.6;
    animation: rotate 10s linear infinite;
  }

  .orbit-1 {
    width: 150px;
    height: 50px;
    transform: rotateX(75deg) rotateZ(0deg);
  }

  .orbit-2 {
    width: 180px;
    height: 70px;
    transform: rotateX(75deg) rotateY(-20deg);
    animation-duration: 15s;
    border-style: dashed;
  }

  .scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
    background-size: 100% 4px;
    z-index: 10;
    pointer-events: none;
  }

  .year-tag {
    position: absolute;
    bottom: 15px;
    right: 15px;
    color: #FADAC1;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    border: 1px solid #FADAC1;
    padding: 3px 8px;
    letter-spacing: 1px;
    z-index: 5;
  }
}

/* アニメーション定義 */
@keyframes rotate {
  from {
    transform: rotateX(75deg) rotateZ(0deg);
  }

  to {
    transform: rotateX(75deg) rotateZ(360deg);
  }
}

@keyframes planet-pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

@keyframes stars-move {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 500px 500px;
  }
}

/*ページを別タブに複製する------------------------------------------------------*/

.opennewtab {
  display: flex;
  align-items: center;
  gap: 12px;
}

.opennewtab a {
  color: #FADAC1;
  text-decoration: none;
  padding: 10px 20px;
  border: 1px solid #FADAC1;
  box-shadow: 0 0 10px #FADAC1;
  border-radius: 10px;
  background-color: #1f1f1f;
  display: inline-block;
}

.opennewtab button {
  color: #FADAC1;
  padding: 10px 20px;
  border: 1px solid #FADAC1;
  box-shadow: 0 0 10px #FADAC1;
  border-radius: 10px;
  background-color: #1f1f1f;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
}

.opennewtab a:hover,
.opennewtab button:hover {
  filter: brightness(1.15);
}


/* ガラス汚れの表現----------------------------------- */

/*FX 共通（画面＝モニター全体に固定）*/
.fx {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;

  pointer-events: none;
  z-index: 999999;
  /* 全UIより前面 */
}

/*動くチリ（ほこり）*/
.fx-dust {
  background-image: url("../images/dust.png");
  background-repeat: repeat;
  background-position: center;
  background-size: 900px auto;

  opacity: 0.1;
  mix-blend-mode: screen;

  animation:
    dust-drift 18s linear infinite,
    dust-flicker 0.9s steps(2) infinite;
}

@keyframes dust-drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  100% {
    transform: translate3d(-2.2%, 1.6%, 0) scale(1.02);
  }
}

@keyframes dust-flicker {
  0% {
    opacity: 0.05;
  }

  50% {
    opacity: 0.07;
  }

  100% {
    opacity: 0.05;
  }
}

/*CRTノイズ*/
.fx-crt {
  background-image: url("../images/crt-noise.png");
  background-repeat: repeat;
  background-position: center;
  background-size: 700px auto;

  opacity: 0.1;
  mix-blend-mode: overlay;

  animation: crt-jitter 0.35s steps(2) infinite;
}

/*CRTノイズを動かしていい感じにする*/
@keyframes crt-jitter {
  0% {
    transform: translate3d(0, 0, 0);
  }

  100% {
    transform: translate3d(-0.6%, 0.4%, 0);
  }
}

/*ガラス汚れ（縦リピート）*/
.fx-glass {
  background-image: url("../images/grime.png");
  background-repeat: repeat-y;
  background-position: center top;
  background-size: 100% 600px;

  opacity: 0.1;
  mix-blend-mode: screen;
}




/*main-content-wrapper-----------------------------------------------------------*/
.main-content-wrapper {
  position: relative;
  /* 子要素 (.window) の absolute の基準点とする */
  width: 100%;
  /* min-heightをbodyと同じかそれ以下に設定。bodyの高さがこのエリアをカバー */
  min-height: 1850px;
  overflow: hidden;
}

/*追加デザイン宇宙船窓景色----------------------------*/

.stellar-stream-body {
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 1850px;
  background-color: #000;
  font-family: 'Courier New', monospace;
}

/* --- 流れる星の層 (Parallax) --- */
.star-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* 遠くの星（小さく、遅い） */
.stars-back {
  background-image: radial-gradient(1px 1px at 20px 30px, #eee, rgba(0, 0, 0, 0)),
    radial-gradient(1px 1px at 150px 120px, #fff, rgba(0, 0, 0, 0)),
    radial-gradient(1px 1px at 300px 250px, #ddd, rgba(0, 0, 0, 0));
  background-size: 400px 300px;
  animation: move-stars 60s linear infinite;
}

/* 中間の星 */
.stars-mid {
  background-image: radial-gradient(2px 2px at 50px 80px, #50A3AB, rgba(0, 0, 0, 0)),
    radial-gradient(2px 2px at 250px 200px, #fff, rgba(0, 0, 0, 0));
  background-size: 300px 200px;
  animation: move-stars 30s linear infinite;
  opacity: 0.6;
}

/* 近くの星（大きく、速い） */
.stars-front {
  background-image: radial-gradient(3px 3px at 100px 50px, #FADAC1, rgba(0, 0, 0, 0)),
    radial-gradient(2px 2px at 400px 350px, #F6723A, rgba(0, 0, 0, 0));
  background-size: 500px 400px;
  animation: move-stars 10s linear infinite;
}

/* --- HUD（計器オーバーレイ） --- */
.hud-overlay {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(80, 163, 171, 0.2);
  pointer-events: none;
  z-index: 10;
}

/* --- パイロット（アクティブオーバーレイ） --- */
.pilot-active {
  position: absolute;
  top: 20px;
  left: 100px;
  color: #F6723A;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 2px;
}

/* 右下の座標データ */
.telemetry {
  position: absolute;
  bottom: 40px;
  right: 80px;
  color: #50A3AB;
  font-size: 10px;
  line-height: 1.5;
  text-align: right;
}

/* ガラスの反射光 */
.glass-reflection {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 40%, rgba(255, 255, 255, 0.02) 50%, transparent 100%);
  pointer-events: none;
}

.scanning-line {
  position: absolute;
  width: 100%;
  height: 2px;
  background: rgba(80, 163, 171, 0.1);
  top: 0;
  animation: scan-down 8s linear infinite;
}


/* 窓外景色アニメーション定義 */
@keyframes move-stars {
  from {
    background-position: 0 0;
  }

  to {
    background-position: -1000px 0;
  }

  /* 左へ流れる */
}

@keyframes scan-down {
  0% {
    top: 0;
  }

  100% {
    top: 100%;
  }
}

/*windows-------------------------------------------------------------------*/
.window {
  position: absolute;
  /* 絶対位置指定でドラッグを可能にする */
  width: 300px;
  min-height: 150px;
  background-color: #1D313C;
  border: 1px solid #FADAC1;
  box-shadow: 0 0 10px #FADAC1;
  z-index: 10;
  /* 重なり順の初期値 */
  resize: both;
  /* ユーザーによるサイズ変更を許可 (任意) */
  overflow: auto;
  /* サイズ変更時にコンテンツがはみ出ないように */
}

/* ウィンドウヘッダー */
.window-header {
  padding: 8px;
  background-color: #50A3AB;
  color: #FADAC1;
  cursor: move;
  /* ドラッグできることを示すカーソル */
  user-select: none;
  /* テキスト選択を防ぎ、ドラッグ操作に集中させる */
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ウィンドウコンテンツ */
.window-content {
  padding: 10px;
}

/* 初期位置の設定 (画面読み込み時の初期配置) */
#window0 {
  top: 50px;
  left: 50px;
  width: 850px;
  height: 400px;
}

#window1 {
  top: 50px;
  left: 950px;
  width: 400px;
  height: 400px;
}

#window2 {
  top: 100px;
  left: 1000px;
  width: 400px;
  height: 400px;
}

#window3 {
  top: 150px;
  left: 1050px;
  width: 400px;
  height: 400px;
}

#window4 {
  top: 200px;
  left: 1100px;
  width: 400px;
  height: 400px;
}

#window5 {
  top: 250px;
  left: 1150px;
  width: 400px;
  height: 400px;
}

#window6 {
  top: 300px;
  left: 1200px;
  width: 400px;
  height: 400px;
}

#window7 {
  top: 350px;
  left: 1250px;
  width: 400px;
  height: 400px;
}

#window8 {
  top: 400px;
  left: 1300px;
  width: 400px;
  height: 400px;
}

#window9 {
  top: 500px;
  left: 500px;
  width: 400px;
  height: 400px;
}

#window10 {
  top: 550px;
  left: 550px;
  width: 400px;
  height: 400px;
}

#window11 {
  top: 600px;
  left: 600px;
  width: 400px;
  height: 400px;
}

#window12 {
  top: 650px;
  left: 650px;
  width: 400px;
  height: 400px;
}

/*複製ボタン------------------------------------------*/
.window-header .win-actions {
  display: flex;
  gap: 6px;
}

.win-btn {
  font-family: inherit;
  font-size: 12px;
  padding: 2px 8px;
  border: 1px solid #FADAC1;
  box-shadow: 0 0 10px #FADAC1;
  background: #1f1f1f;
  color: #FADAC1;
  cursor: pointer;
  border-radius: 6px;
}

.win-btn:hover {
  filter: brightness(1.2);
}

/*複製削除ボタン---------------------------------------------------*/

.win-btn-danger {
  border-color: #C43B39;
  color: #C43B39;
}

.win-btn-danger:hover {
  filter: brightness(1.2);
}

/*window0-------------------------------------------------*/
/*window1-------------------------------------------------*/

/* 上部の「現在情報 + 切替ボタン」 */
#window1 .window1-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

/* 切替ボタン */
#toggleClockMode {
  padding: 6px 10px;
  border: 1px solid #FADAC1;
  background: #1f1f1f;
  color: #FADAC1;
  cursor: pointer;
  border-radius: 6px;
}

#toggleClockMode:hover {
  filter: brightness(1.2);
}

#datetime {
  padding: 30px 32px;
  border: 1px solid #FADAC1;
  box-shadow: 0 0 10px #FADAC1;
  border-radius: 10px;
  background-color: #1f1f1f;
}

.date-display {
  font-size: 1.5em;
  margin-bottom: 30px;
  font-weight: 300;
}

.time-display {
  font-size: 3em;
  font-weight: bold;
  letter-spacing: 2px;
  margin-bottom: 28px;
}

/* アナログ側------------------ */
#analogWrap {
  padding: 10px;
  border: 1px solid #FADAC1;
  box-shadow: 0 0 10px #FADAC1;
  border-radius: 10px;
  background-color: #1f1f1f;
  display: flex;
  justify-content: center;
}

#analogClock {
  background: #1D313C;
  border-radius: 50%;
  margin-bottom: 4px;
}

/* 表示/非表示 */
.hidden {
  display: none;
}

/* どの window でもアナログ領域はデフォルト非表示 */
.window #analogWrap {
  display: none;
}

/* is-active の時だけ表示 */
.window #analogWrap.is-active {
  display: flex;
}


/*window2-------------------------------------------------*/

#clock {
  margin: 10px 10px;
  padding: 10px 40px;
  border: 2px solid #FADAC1;
  box-shadow: 0 0 10px #FADAC1;
  border-radius: 10px;
  letter-spacing: 5px;
  background: #1f1f1f;
  font-size: 300%;
}

/*------------------------*/

.stopwatch-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 50%;

  p {
    font-size: 100%;
  }
}

/* 時間表示のスタイル */
#stopwatch-display {
  font-size: 2.5em;
  font-family: 'Consolas', monospace;
  padding: 10px 20px;
  border: 1px solid #FADAC1;
  box-shadow: 0 0 10px #FADAC1;
  border-radius: 5px;
  background-color: #1f1f1f;
}

/* ボタンのスタイル */
#stopwatch-controls button {
  padding: 10px 15px;
  margin: 5px;
  font-size: 1em;
  cursor: pointer;
  border: none;
  border-radius: 5px;
  transition: background-color 0.2s;
}

#start-stop-btn {
  background-color: #50A3AB;
  color: #FADAC1;
}

#start-stop-btn.stop {
  background-color: #C43B39;
}

#reset-btn {
  background-color: #F6723A;
  color: #FADAC1;
}

#stopwatch-controls button:disabled {
  background-color: #ccc;
  cursor: default;
}

/*window3-------------------------------------------------*/

.window-content textarea {
  width: calc(100% - 20px);
  min-height: 100px;
  padding: 10px;
  box-sizing: border-box;
  border: 1px solid #FADAC1;
  font-family: monospace;
  resize: none;
  overflow: auto;
}

/* memo window全体を縦flexにして、中身を伸縮できるようにする */
.window[data-app="memo"] {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ヘッダー分を除いた残りを window-content が占める */
.window[data-app="memo"] .window-content {
  flex: 1 1 auto;
  min-height: 0;
  /* これ重要：textareaがはみ出さず縮む */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ツールバーは固定、高さは中身に任せる */
.window[data-app="memo"] .memo-toolbar {
  flex: 0 0 auto;
}

/* textareaが残り全部を使う（＝windowサイズに追従） */
.window[data-app="memo"] .memo-area {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  border: 1px solid #FADAC1;
  font-family: monospace;
  resize: none;
  overflow: auto;
}


/*window4-------------------------------------------------*/

.window[data-app="imagedisplay"] {
  display: flex;
  flex-direction: column;
}

.window[data-app="imagedisplay"] .window-header {
  flex: 0 0 auto;
}

.window[data-app="imagedisplay"] .window-content {
  padding: 10px;
  box-sizing: border-box;
  margin-bottom: 10px;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.window[data-app="imagedisplay"] #image-display-container {
  width: 100%;
  border: 1px dashed #FADAC1;

  flex: 1 1 auto;
  min-height: 0;

  display: flex;
  justify-content: center;
  align-items: center;

  overflow: hidden;
}

.window[data-app="imagedisplay"] #uploaded-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/*window5-------------------------------------------------*/

.calculator-content {
  display: flex;
  flex-direction: column;
  padding: 10px;
  height: calc(100% - 38px);
  box-sizing: border-box;
}

#calc-display {
  background-color: #1f1f1f;
  color: #FADAC1;
  font-size: 2em;
  text-align: right;
  padding: 6px;
  margin-bottom: 10px;
  border-radius: 5px;
  box-shadow: 0 0 5px #FADAC1;
  min-height: 30px;
  overflow-x: auto;
}

#calc-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  flex-grow: 1;
}

.calc-btn {
  padding: 10px;
  font-size: 1.2em;
  border: none;
  border-radius: 5px;
  box-shadow: 0 0 5px #FADAC1;
  cursor: pointer;
  background-color: #1f1f1f;
  color: #FADAC1;
  transition: background-color 0.1s;
}

.calc-btn:hover {
  background-color: #1D313C;
}

.operator {
  background-color: #F6723A;
  color: #FADAC1;
}

.clear {
  background-color: #C43B39;
  color: #FADAC1;
}

.equal {
  background-color: #50A3AB;
  color: #FADAC1;
}

.zero {
  grid-column: span 2;
}

.plus {
  grid-row: span 2;
}

/*window6-------------------------------------------------*/

.audio-thumbnail {
  width: 370px;
  height: 200px;
  margin: 10px auto;
  border: 1px solid #FADAC1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1f1f1f;
}

.audio-thumbnail img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/*window7-------------------------------------------------*/

#drawingCanvas {
  border: 1px solid #FADAC1;
  background-color: #FFFFFF;
}

/*window8-------------------------------------------------*/

.video-box {
  display: grid;
  gap: 10px;
}

.video-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.loop-toggle {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  user-select: none;
}

.js-video-player {
  width: 100%;
  max-height: 360px;
  background: #000;
  border-radius: 8px;
}

.video-meta {
  font-size: 12px;
  opacity: 0.8;
}

.window-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.win-actions {
  margin-left: auto;
  display: inline-flex;
  gap: 6px;
}

/*window9-------------------------------------------------*/

.module-mouse {
  grid-column: 2;
  background: #F4E55A;
  color: #253054;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin-bottom: 10px;
}

.gauge-label {
  font-size: 12px;
  color: var(--accent-yellow);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.gauge-value {
  font-size: 32px;
  font-weight: bold;
}

.mouse-coords {
  font-size: 60px;
  font-weight: 900;
  word-break: break-all;
  line-height: 0.9;
}

/* --- モジュール：システムゲージ --- */

.module-gauges {
  grid-column: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gauge-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #F4E55A;
  padding: 15px;
  position: relative;
}

.gauge-label {
  font-size: 12px;
  color: #F4E55A;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.gauge-value {
  font-size: 32px;
  font-weight: bold;
}

.bar-container {
  width: 100%;
  height: 10px;
  background: #253054;
  margin-top: 10px;
  position: relative;
}

.bar-fill {
  height: 100%;
  background: #CC2727;
  width: 0%;
  transition: width 0.1s linear;
}

/*window10-------------------------------------------------*/
/*サイドメニュー----------------------------------------------------------------------*/

.side-overlay {
  position: fixed;
  inset: 0;
  background: #1d313c50;
  z-index: 9998;
}

.side-menu {
  position: fixed;
  top: 0;
  left: 0;
  height: 100dvh;
  width: min(500px, 86vw);
  transform: translateX(-105%);
  transition: transform 0.22s ease;
  z-index: 9999;

  background: #1d313c80;
  border-right: 1px solid #FADAC1;
  box-shadow: 0 0 16px #FADAC1;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  display: flex;
  flex-direction: column;
}

.side-menu.is-open {
  transform: translateX(0);
}

.side-menu__head {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;

  border-bottom: 1px solid #FADAC1;
}

.side-menu__title {
  color: #FADAC1;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.side-menu__close {
  width: 36px;
  height: 36px;
  border-radius: 10px;

  border: 1px solid #FADAC1;
  background: #1f1f1f;
  color: #FADAC1;
  box-shadow: 0 0 10px #FADAC1;
  cursor: pointer;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  transition: filter 0.15s, transform 0.06s;
}

.side-menu__close:hover {
  filter: brightness(1.15);
}

.side-menu__close:active {
  transform: translateY(1px);
}

.side-menu__body {
  padding: 12px;
  display: grid;
  gap: 10px;
  overflow: auto;
}

.side-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;

  padding: 10px 10px;
  border-radius: 12px;

  border: 1px solid #FADAC1;
  background: #1f1f1f;
  color: #FADAC1;
  box-shadow: 0 0 10px #FADAC1;

  text-decoration: none;
  cursor: pointer;

  transition: filter 0.15s, transform 0.06s;
}

.side-link:hover {
  filter: brightness(1.12);
}

.side-link:active {
  transform: translateY(1px);
}

.side-sep {
  border: none;
  height: 1px;
  background: #FADAC1;
  margin: 6px 0;
}

.side-btn-danger {
  border-color: #C43B39;
  color: #C43B39;
  box-shadow: 0 0 10px #C43B39;
}

#clearSiteDataBtn {
  border-color: #C43B39;
  box-shadow: 0 0 10px #C43B39;
  color: #C43B39;
}

/* Side menu - Window list --------------------------*/

.side-section__title {
  color: #FADAC1;
  font-size: 12px;
  letter-spacing: 1px;
  opacity: 0.85;
  margin-bottom: 6px;
}

.window-list {
  display: grid;
  gap: 8px;
}

.window-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;

  padding: 8px;
  border-radius: 12px;
  border: 1px solid #FADAC1;
  background: #1f1f1f;
  box-shadow: 0 0 10px #FADAC1;
}

.window-item__title {
  color: #FADAC1;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window-item__actions {
  display: inline-flex;
  gap: 6px;
}

.window-item__btn {
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 8px;

  border: 1px solid #FADAC1;
  background: #1f1f1f;
  color: #FADAC1;
  box-shadow: 0 0 8px #FADAC1;
  cursor: pointer;

  transition: filter .15s, transform .06s;
}

.window-item__btn:hover {
  filter: brightness(1.15);
}

.window-item__btn:active {
  transform: translateY(1px);
}

.window-item__btn--danger {
  border-color: #C43B39;
  color: #C43B39;
  box-shadow: 0 0 8px #C43B39;
}

/*DockWindow------------------------------------------------------------------------*/

/*Dock専用の見た目*/
.window[data-app="dock"] .window-content {
  display: grid;
  gap: 10px;
}

.dock-hint {
  font-size: 12px;
  opacity: .85;
  border: 1px dashed #FADAC1;
  padding: 8px;
  border-radius: 10px;
}

.dock-list {
  display: grid;
  gap: 8px;
}

.dock-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;

  padding: 8px;
  border-radius: 12px;
  border: 1px solid #FADAC1;
  background: #1f1f1f;
  box-shadow: 0 0 10px #FADAC1;
}

.dock-item__title {
  font-size: 12px;
  color: #FADAC1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dock-item__actions {
  display: inline-flex;
  gap: 6px;
}

/*ドロップ可能位置のハイライト*/
.window[data-app="dock"].dock--over {
  outline: 2px dashed #FADAC1;
  outline-offset: 3px;
  box-shadow: 0 0 18px #FADAC1;
}

/*footer-------------------------------------------------*/

footer {
  background-color: #333;
  color: #fff;
  padding: 40px 20px 20px;
  width: 100%;
}

.footer-content {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
  border-bottom: 1px solid #FADAC1;
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.footer-section {
  margin: 10px;
  min-width: 150px;
}

.footer-section img {
  width: 2em;
  height: 2em;
  transition: transform 0.15s ease;
}

.footer-section img:hover {
  transform: scale(1.5);
  /*少し拡大*/
  cursor: none;
  /*カーソルを非表示*/
}

.footer-section p {
  font-size: 1em;
  font-weight: 900;
  color: #F6723A;
  -webkit-text-stroke: 0.5px #FADAC1;
  text-decoration: none;
  /* 下線を削除 */
  margin: 0;
  padding-bottom: 20px;
}

.footer-section h3 {
  font-size: 1.1em;
  margin-bottom: 15px;
  color: #FADAC1;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section ul li {
  margin-bottom: 8px;
}

.footer-section a {
  color: #FADAC1;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-section a:hover {
  color: #50A3AB;
}


/*スクロールボタン------------------------------------------------------*/

/* スムーズスクロール（CSSでのみ管理） */
html {
  scroll-behavior: smooth;
}

/* 右下固定ボタン */
.scroll-top-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;

  width: 46px;
  height: 46px;

  display: flex;
  align-items: center;
  justify-content: center;

  background-color: #1D313C;
  color: #FADAC1;

  border: 1px solid #50A3AB;
  border-radius: 10px;

  font-family: "Courier New", monospace;
  font-size: 16px;
  font-weight: bold;
  text-decoration: none;

  box-shadow:
    0 0 10px rgba(80, 163, 171, 0.6),
    inset 0 0 6px rgba(250, 218, 193, 0.2);

  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.scroll-top-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow:
    0 0 16px #FADAC1,
    inset 0 0 8px rgba(250, 218, 193, 0.4);
  filter: brightness(1.1);
  cursor: none;
}

/* 押したとき */
.scroll-top-btn:active {
  transform: translateY(1px) scale(0.98);
}

/*1hdg48ayt1-------------------------------------------------*/


/*WorldItems(Shapes)------------*/
.shape-item {
  position: absolute;
  width: 18px;
  height: 18px;
  cursor: grab;
  user-select: none;
  opacity: 0.92;
  z-index: 50;

  border: 1px solid #FADAC1;
  box-shadow: 0 0 10px #FADAC1;
  background: rgba(250, 218, 193, 0.85);
  border-radius: 4px;
}

.shape-item:active {
  cursor: grabbing;
}

.shape-item[data-kind="circle"] {
  border-radius: 50%;
}

.shape-item[data-kind="square"] {
  border-radius: 3px;
}

.shape-item[data-kind="triangle"] {
  width: 0;
  height: 0;
  background: none;
  border: none;
  box-shadow: none;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 18px solid rgba(250, 218, 193, 0.85);
  filter: drop-shadow(0 0 10px rgba(250, 218, 193, 0.85));
}

/*DockWindow Artifactslist---------------------------------------*/
.dock-subtitle {
  font-size: 12px;
  opacity: .85;
  letter-spacing: 1px;
}

.dock-artifacts {
  display: grid;
  gap: 8px;
}

.art-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;

  padding: 8px;
  border-radius: 12px;
  border: 1px solid #FADAC1;
  background: #1f1f1f;
  box-shadow: 0 0 10px #FADAC1;
}

.art-item__title {
  font-size: 12px;
  color: #FADAC1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/*EngineeringTerminalWindow----------------------------------------*/
.engterm {
  --bg: #0a0a0a;
  --color: #F6723A;
  --dim: rgba(246, 114, 58, .5);

  background: var(--bg);
  color: var(--color);
  font-family: 'Consolas', monospace;

  text-transform: uppercase;
  text-shadow: 0 0 2px var(--dim), 0 0 10px var(--dim);
  border: 1px solid var(--color);
  padding: 10px;
  position: relative;
  min-height: 320px;
}

/*横線はWindow内だけ*/
.engterm::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, .25) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  opacity: .75;
}

.engterm__container {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
}

.engterm__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px dashed var(--dim);
  padding-bottom: 8px;
  font-size: 12px;
}

.engterm__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.engterm__col {
  display: grid;
  gap: 10px;
}

.engterm__box {
  border: 1px solid var(--dim);
  padding: 10px;
}

.engterm__title {
  display: inline-block;
  padding: 0 6px;
  transform: translateY(-16px);
  background: var(--bg);
  font-size: 12px;
}

.engterm__row {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  opacity: .9;
}

.engterm__dump {
  max-height: 180px;
  overflow: hidden;
  font-size: 11px;
  opacity: .85;
}

.engterm__grow {
  min-height: 200px;
}

.engterm__foot {
  border-top: 1px dashed var(--dim);
  padding-top: 8px;
  font-size: 12px;
}

.engterm__blink {
  animation: engterm_blink 1s step-end infinite;
}

@keyframes engterm_blink {
  50% {
    opacity: 0;
  }
}


/*Craft/GatewayUI---------------------------------------------------*/
.craft-panel {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.craft-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px dashed #FADAC1;
  border-radius: 10px;
  padding: 8px;
  background: #1f1f1f;
}

.craft-row b {
  color: #F6723A;
}

.craft-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.craft-note {
  font-size: 12px;
  opacity: .85;
  line-height: 1.45;
}

/*一時的------------------------*/