/* =========================================================
   IGO.EXE — Windows 95 風スタイル
   ========================================================= */
:root {
  --desk: #008080;
  --desk-dark: #006a6a;
  --face: #c0c0c0;
  --face-hi: #dfdfdf;
  --white: #ffffff;
  --shadow: #808080;
  --dark: #0a0a0a;
  --navy: #000080;
  --navy2: #1084d0;
  --inactive: #808080;
  --inactive2: #b5b5b5;
  --text: #000000;
  --paper: #ffffff;
  --select: #000080;
  --tooltip: #ffffe1;
  --red: #c00000;
  --font: "DotGothic16", "MS UI Gothic", "MS Gothic", "Osaka-Mono", "Hiragino Sans", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--desk);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.35;
  overflow: hidden;
  -webkit-font-smoothing: none;
  font-smooth: never;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* CRT のうっすらした走査線 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0.035) 0 1px, transparent 1px 3px);
  z-index: 9999;
}

body.busy, body.busy * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='22' shape-rendering='crispEdges'%3E%3Cpath d='M1 0h14v2h-1v4l-4 4v2l4 4v4h1v2H1v-2h1v-4l4-4v-2L2 6V2H1z' fill='%23000'/%3E%3Cpath d='M3 2h10v3.5l-4 4v3l4 4V20H3v-3.5l4-4v-3l-4-4z' fill='%23fff'/%3E%3Cpath d='M5 5h6l-3 3zM4 19l4-4 4 4z' fill='%23c8a000'/%3E%3C/svg%3E") 8 11, progress !important; }

button, input, select { font-family: var(--font); font-size: 14px; }

/* ---------- デスクトップ ---------- */
#desktop {
  position: fixed;
  inset: 0 0 34px 0;
  overflow: hidden;
}

.icons {
  position: absolute;
  top: 12px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 1;
}

.icon {
  width: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: 0;
  padding: 2px;
  color: #fff;
  cursor: pointer;
}
img.px { image-rendering: pixelated; image-rendering: crisp-edges; }
.icon img { width: 40px; height: 40px; }
.icon span {
  font-size: 13px;
  padding: 0 3px;
  text-align: center;
  line-height: 1.2;
  border: 1px dotted transparent;
}
.icon:focus { outline: none; }
.icon:focus span, .icon.selected span {
  background: var(--select);
  border-color: #ffff80;
}
.icon:focus svg, .icon.selected svg { filter: brightness(0.6) sepia(1) hue-rotate(190deg) saturate(4); }

/* ---------- ウィンドウ共通 ---------- */
.window {
  position: absolute;
  background: var(--face);
  padding: 3px;
  box-shadow:
    inset -1px -1px var(--dark),
    inset 1px 1px var(--face-hi),
    inset -2px -2px var(--shadow),
    inset 2px 2px var(--white);
}
.window[hidden] { display: none !important; }

.titlebar {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 3px 0 4px;
  background: linear-gradient(90deg, var(--navy), var(--navy2));
  color: #fff;
  font-weight: normal;
  touch-action: none;
}
.window.inactive .titlebar { background: linear-gradient(90deg, var(--inactive), var(--inactive2)); color: #d4d0c8; }
.titlebar .ttl-icon { width: 16px; height: 16px; flex: none; image-rendering: pixelated; }
.titlebar .ttl-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.5px;
  cursor: default;
}
.tbtns { display: flex; gap: 0; }
.tbtn {
  width: 16px;
  height: 14px;
  padding: 0;
  margin-left: 2px;
  background: var(--face);
  border: 0;
  box-shadow:
    inset -1px -1px var(--dark),
    inset 1px 1px var(--white),
    inset -2px -2px var(--shadow),
    inset 2px 2px var(--face-hi);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.tbtn:active { box-shadow: inset -1px -1px var(--white), inset 1px 1px var(--dark), inset -2px -2px var(--face-hi), inset 2px 2px var(--shadow); }
.tbtn svg { width: 8px; height: 7px; shape-rendering: crispEdges; }
.tbtn.close { margin-left: 2px; }

/* メニューバー */
.menubar {
  display: flex;
  gap: 0;
  padding: 1px 0;
  position: relative;
}
.menu-root { position: relative; }
.menu-btn {
  background: none;
  border: 0;
  padding: 2px 8px;
  cursor: pointer;
  color: var(--text);
}
.menu-btn u { text-decoration: underline; }
.menu-root.open > .menu-btn { background: var(--select); color: #fff; }
.menu-list {
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 210px;
  background: var(--face);
  padding: 3px;
  z-index: 50;
  box-shadow:
    inset -1px -1px var(--dark),
    inset 1px 1px var(--face-hi),
    inset -2px -2px var(--shadow),
    inset 2px 2px var(--white),
    3px 3px 0 rgba(0,0,0,0.25);
  display: none;
}
.menu-root.open > .menu-list { display: block; }
.menu-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  padding: 3px 18px 3px 22px;
  text-align: left;
  cursor: pointer;
  position: relative;
  color: var(--text);
  white-space: nowrap;
}
.menu-item:hover, .menu-item:focus { background: var(--select); color: #fff; outline: none; }
.menu-item .key { margin-left: auto; padding-left: 24px; }
.menu-item.checked::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -5px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='7' shape-rendering='crispEdges'%3E%3Cpath d='M6 0h1v2h-1v1h-1v1h-1v1h-1v1h-1v1h-1v-1h-1v-1h-1v-3h1v1h1v1h1v-1h1v-1h1v-1h1z' fill='%23000'/%3E%3C/svg%3E") no-repeat;
}
.menu-item.checked:hover::before, .menu-item.checked:focus::before { filter: invert(1); }
.menu-item[disabled] { color: var(--shadow); text-shadow: 1px 1px 0 var(--white); pointer-events: none; }
.menu-sep { height: 2px; margin: 3px 2px; border-top: 1px solid var(--shadow); border-bottom: 1px solid var(--white); }

/* ---------- 部品 ---------- */
.btn {
  min-width: 75px;
  min-height: 25px;
  padding: 3px 10px;
  background: var(--face);
  color: var(--text);
  border: 0;
  cursor: pointer;
  box-shadow:
    inset -1px -1px var(--dark),
    inset 1px 1px var(--white),
    inset -2px -2px var(--shadow),
    inset 2px 2px var(--face-hi);
  position: relative;
}
.btn:focus-visible { outline: 1px dotted #000; outline-offset: -5px; }
.btn:active:not([disabled]), .btn.pressed {
  box-shadow:
    inset -1px -1px var(--white),
    inset 1px 1px var(--dark),
    inset -2px -2px var(--face-hi),
    inset 2px 2px var(--shadow);
  padding: 4px 9px 2px 11px;
}
.btn.default {
  box-shadow:
    inset -1px -1px var(--dark),
    inset 1px 1px var(--dark),
    inset -2px -2px var(--dark),
    inset 2px 2px var(--white),
    inset -3px -3px var(--shadow),
    inset 3px 3px var(--face-hi);
}
.btn[disabled] { color: var(--shadow); text-shadow: 1px 1px 0 var(--white); cursor: default; }
.btn .bicon { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; image-rendering: pixelated; }

.sunken {
  background: var(--paper);
  box-shadow:
    inset -1px -1px var(--white),
    inset 1px 1px var(--shadow),
    inset -2px -2px var(--face-hi),
    inset 2px 2px var(--dark);
}

.groupbox {
  border: 1px solid var(--shadow);
  box-shadow: 1px 1px 0 var(--white), inset 1px 1px 0 var(--white);
  padding: 12px 8px 8px;
  margin: 8px 0 0;
  position: relative;
}
.groupbox > legend, .groupbox > .legend {
  position: absolute;
  top: -9px;
  left: 7px;
  padding: 0 3px;
  background: var(--face);
  font-size: 13px;
}

.field-row { display: flex; align-items: center; gap: 6px; margin: 4px 0; }

/* ラジオボタン / チェックボックス */
.radio, .check { display: flex; align-items: center; gap: 6px; cursor: pointer; margin: 3px 0; }
.radio input, .check input { position: absolute; opacity: 0; pointer-events: none; }
.radio .mark {
  width: 12px; height: 12px; flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' shape-rendering='crispEdges'%3E%3Cpath d='M4 0h4v1h2v1h1v2h1v4h-1v2h-1v1h-2v1h-4v-1h-2v-1h-1v-2h-1v-4h1v-2h1v-1h2z' fill='%23808080'/%3E%3Cpath d='M4 1h4v1h2v2h1v4h-1v2h-2v1h-4v-1h-2v-2h-1v-4h1v-2h2z' fill='%230a0a0a'/%3E%3Cpath d='M4 2h4v1h1v1h1v4h-1v1h-1v1h-4v-1h-1v-1h-1v-4h1v-1h1z' fill='%23fff'/%3E%3C/svg%3E");
}
.radio input:checked + .mark {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' shape-rendering='crispEdges'%3E%3Cpath d='M4 0h4v1h2v1h1v2h1v4h-1v2h-1v1h-2v1h-4v-1h-2v-1h-1v-2h-1v-4h1v-2h1v-1h2z' fill='%23808080'/%3E%3Cpath d='M4 1h4v1h2v2h1v4h-1v2h-2v1h-4v-1h-2v-2h-1v-4h1v-2h2z' fill='%230a0a0a'/%3E%3Cpath d='M4 2h4v1h1v1h1v4h-1v1h-1v1h-4v-1h-1v-1h-1v-4h1v-1h1z' fill='%23fff'/%3E%3Cpath d='M5 4h2v1h1v2h-1v1h-2v-1h-1v-2h1z' fill='%23000'/%3E%3C/svg%3E");
}
.check .mark {
  width: 13px; height: 13px; flex: none;
  background: #fff;
  box-shadow: inset -1px -1px var(--white), inset 1px 1px var(--shadow), inset -2px -2px var(--face-hi), inset 2px 2px var(--dark);
}
.check input:checked + .mark {
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='7' shape-rendering='crispEdges'%3E%3Cpath d='M6 0h1v2h-1v1h-1v1h-1v1h-1v1h-1v1h-1v-1h-1v-1h-1v-3h1v1h1v1h1v-1h1v-1h1v-1h1z' fill='%23000'/%3E%3C/svg%3E") no-repeat 3px 3px;
}
.radio input:focus-visible ~ .lbl, .check input:focus-visible ~ .lbl { outline: 1px dotted #000; }

/* Win95 のプログレスバー (青いブロック) */
.progress {
  height: 20px;
  padding: 3px;
  background: var(--face);
  box-shadow: inset -1px -1px var(--white), inset 1px 1px var(--shadow);
  overflow: hidden;
}
.progress .bar {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(90deg, var(--navy) 0 9px, transparent 9px 11px);
  transition: width 0.15s steps(4);
}

/* ---------- メインウィンドウ ---------- */
#main-win {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(880px, calc(100vw - 16px));
  z-index: 10;
}
#main-win.dragged { transform: none; }

.win-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 8px;
  padding: 6px 4px 4px;
}

.board-frame {
  padding: 8px;
  background: var(--face);
  box-shadow:
    inset -1px -1px var(--white),
    inset 1px 1px var(--shadow),
    inset -2px -2px var(--face-hi),
    inset 2px 2px var(--dark);
  display: grid;
  place-items: center;
  min-width: 0;
}
.board-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: min(560px, calc(100vh - 200px));
  min-width: 240px;
  display: grid;
  place-items: center;
  background: #1b1b1b;
}
#board {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: manipulation;
  cursor: pointer;
}

.side { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.player {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px;
  align-items: center;
  padding: 6px;
  position: relative;
}
.player .avatar {
  width: 52px;
  height: 52px;
  background: #fff;
  box-shadow: inset -1px -1px var(--white), inset 1px 1px var(--shadow), inset -2px -2px var(--face-hi), inset 2px 2px var(--dark);
  padding: 2px;
  display: grid;
  place-items: center;
}
.player .avatar canvas { width: 48px; height: 48px; image-rendering: pixelated; }
.player .pname { font-size: 15px; display: flex; align-items: center; gap: 6px; }
.player .pname .stone-chip { width: 14px; height: 14px; image-rendering: pixelated; flex: none; }
.player .pinfo { font-size: 12px; color: #202020; }
.player.turn::after {
  content: "◀ 手番";
  position: absolute;
  right: 6px;
  top: 6px;
  font-size: 12px;
  color: var(--red);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { visibility: hidden; } }

.stats {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  font-size: 13px;
}
.stats dt { color: #202020; }
.stats dd { margin: 0; text-align: right; }

.evalbar {
  position: relative;
  height: 16px;
  background: #fff;
  box-shadow: inset -1px -1px var(--white), inset 1px 1px var(--shadow), inset -2px -2px var(--face-hi), inset 2px 2px var(--dark);
  overflow: hidden;
  margin-top: 4px;
}
.evalbar .eb-black {
  position: absolute;
  top: 2px; bottom: 2px; left: 2px;
  width: 50%;
  background: repeating-linear-gradient(90deg, #000 0 2px, #202020 2px 3px);
  transition: width 0.4s steps(8);
}
.evalbar .eb-mid { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--red); }
.eval-label { font-size: 12px; margin-top: 3px; min-height: 16px; }

.btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}
.btn-grid .btn { min-width: 0; padding-left: 4px; padding-right: 4px; }

.think {
  margin-top: 8px;
  font-size: 12px;
}
.think .progress { margin-top: 3px; }

.statusbar {
  display: flex;
  gap: 3px;
  margin-top: 4px;
  font-size: 12px;
}
.statusbar > div {
  padding: 2px 6px;
  box-shadow: inset -1px -1px var(--white), inset 1px 1px var(--shadow);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.statusbar .grow { flex: 1; }

/* ---------- ダイアログ ---------- */
.modal-layer {
  position: fixed;
  inset: 0 0 34px 0;
  z-index: 100;
  display: grid;
  place-items: center;
}
.modal-layer[hidden] { display: none; }
.dialog {
  position: relative;
  width: min(420px, calc(100vw - 20px));
  animation: pop 0.12s steps(3);
}
@keyframes pop { from { transform: scale(0.85); opacity: 0.2; } to { transform: scale(1); opacity: 1; } }
.dialog .dlg-body { padding: 14px 12px 10px; display: flex; gap: 14px; align-items: flex-start; }
.dialog .dlg-icon { width: 32px; height: 32px; flex: none; image-rendering: pixelated; }
.dialog .dlg-msg { flex: 1; white-space: pre-line; padding-top: 4px; font-size: 14px; }
.dialog .dlg-btns { display: flex; justify-content: center; gap: 8px; padding: 4px 10px 12px; flex-wrap: wrap; }

.score-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.score-table th, .score-table td { padding: 2px 6px; text-align: right; }
.score-table th:first-child, .score-table td:first-child { text-align: left; }
.score-table thead th { border-bottom: 1px solid var(--shadow); font-weight: normal; }
.score-table tfoot td { border-top: 1px solid var(--shadow); }
.score-big { font-size: 20px; margin: 6px 0 2px; color: var(--navy); }

.newgame-body { padding: 10px 12px 4px; }
.newgame-body .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.level-note { font-size: 12px; color: #303030; margin-top: 4px; }
.lvl-icon { width: 16px; height: 16px; vertical-align: -3px; margin-right: 3px; }

.rules-note {
  font-size: 12px;
  color: #202020;
  padding: 6px 2px 0;
}

/* メモ帳 (ルール説明) */
#notepad {
  width: min(560px, calc(100vw - 16px));
  z-index: 20;
  left: 120px;
  top: 40px;
}
.notepad-text {
  height: min(60vh, 460px);
  overflow-y: auto;
  padding: 8px 10px;
  margin: 2px;
  font-size: 14px;
  line-height: 1.6;
  user-select: text;
  -webkit-user-select: text;
  white-space: pre-wrap;
}
.notepad-text h3 { font-size: 15px; margin: 10px 0 2px; font-weight: normal; color: var(--navy); }
.notepad-text p { margin: 0 0 6px; }
.notepad-text .fig { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 8px; }
.notepad-text .fig figure { margin: 0; text-align: center; font-size: 12px; }
.notepad-text .fig canvas { width: 96px; height: 96px; image-rendering: pixelated; border: 1px solid #808080; }

/* スクロールバー (Win95 風) */
.notepad-text::-webkit-scrollbar { width: 16px; background: #dcdcdc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2'%3E%3Crect width='1' height='1' fill='%23fff'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%23fff'/%3E%3C/svg%3E"); }
.notepad-text::-webkit-scrollbar-thumb {
  background: var(--face);
  box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--face-hi), inset -2px -2px var(--shadow), inset 2px 2px var(--white);
}

/* ---------- BGMプレーヤー ---------- */
#player {
  width: min(290px, calc(100vw - 16px));
  right: 16px;
  top: 24px;
  z-index: 20;
}
.player-body { padding: 6px 4px 4px; }
.lcd {
  position: relative;
  overflow: hidden;
  padding: 6px 8px 5px;
  background: #04160c;
  color: #46ff96;
  text-shadow: 0 0 4px rgba(70, 255, 150, 0.45);
  box-shadow:
    inset -1px -1px var(--white),
    inset 1px 1px var(--shadow),
    inset -2px -2px var(--face-hi),
    inset 2px 2px var(--dark);
}
.lcd::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.25) 0 1px, transparent 1px 3px);
}
.lcd-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
#lcd-track { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#lcd-vis { display: block; width: 100%; height: 30px; margin-top: 5px; image-rendering: pixelated; }
.lcd-status { font-size: 11px; margin-top: 3px; }
.player-ctrls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 8px 0 4px; }
.pbtn { min-width: 0; padding: 4px 0; display: grid; place-items: center; }
.pbtn svg { width: 14px; height: 10px; fill: currentColor; shape-rendering: crispEdges; }
.pbtn[disabled] svg { fill: var(--shadow); filter: drop-shadow(1px 1px 0 var(--white)); }
.vol label { flex: none; }
.vol input { flex: 1; min-width: 0; }
.tracklist { list-style: none; margin: 6px 0 0; padding: 2px; max-height: 110px; overflow-y: auto; font-size: 13px; }
.tracklist li { display: flex; gap: 8px; padding: 2px 6px; cursor: pointer; }
.tracklist li .no { color: #606060; }
.tracklist li.sel { background: var(--select); color: #fff; }
.tracklist li.sel .no { color: #b8b8ff; }

/* Win95 風スライダー */
input[type=range] { -webkit-appearance: none; appearance: none; height: 22px; margin: 0; background: transparent; }
input[type=range]:focus { outline: none; }
input[type=range]:focus-visible { outline: 1px dotted #000; }
input[type=range]::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--dark);
  box-shadow: 1px 1px 0 var(--white), -1px -1px 0 var(--shadow);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 21px;
  margin-top: -9px;
  border: 0;
  background: var(--face);
  box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--white), inset -2px -2px var(--shadow), inset 2px 2px var(--face-hi);
}
input[type=range]::-moz-range-track {
  height: 4px;
  background: var(--dark);
  box-shadow: 1px 1px 0 var(--white), -1px -1px 0 var(--shadow);
}
input[type=range]::-moz-range-thumb {
  width: 11px;
  height: 21px;
  border: 0;
  border-radius: 0;
  background: var(--face);
  box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--white), inset -2px -2px var(--shadow), inset 2px 2px var(--face-hi);
}

/* ---------- タスクバー ---------- */
#taskbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 34px;
  background: var(--face);
  box-shadow: inset 0 1px var(--face-hi), inset 0 2px var(--white);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 3px 2px;
  z-index: 200;
}
#start-btn {
  min-width: 0;
  flex: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 5px;
  font-weight: bold;
  height: 26px;
}
#start-btn img { width: 20px; height: 20px; }
.task-sep { width: 2px; height: 24px; border-left: 1px solid var(--shadow); border-right: 1px solid var(--white); margin: 0 2px; }
.task-btn {
  min-width: 0;
  max-width: 200px;
  flex: 0 1 200px;
  height: 26px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.task-btn.active {
  background: repeating-conic-gradient(#fff 0 25%, var(--face) 0 50%) 0 0 / 2px 2px;
  box-shadow: inset -1px -1px var(--white), inset 1px 1px var(--dark), inset -2px -2px var(--face-hi), inset 2px 2px var(--shadow);
}
.task-btn img { width: 16px; height: 16px; flex: none; }
.task-btn[hidden] { display: none; }
.tray {
  flex: none;
  white-space: nowrap;
  margin-left: auto;
  height: 26px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  font-size: 13px;
  box-shadow: inset -1px -1px var(--white), inset 1px 1px var(--shadow);
}
.tray img { width: 16px; height: 16px; cursor: pointer; display: block; }

#start-menu {
  position: fixed;
  left: 2px;
  bottom: 32px;
  width: 230px;
  z-index: 300;
  display: flex;
  padding: 3px;
}
#start-menu[hidden] { display: none; }
.start-side {
  width: 26px;
  background: linear-gradient(0deg, var(--navy), var(--navy2));
  color: var(--face);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 18px;
  padding: 8px 0;
  display: flex;
  align-items: center;
  letter-spacing: 1px;
}
.start-side b { color: #fff; font-weight: bold; }
.start-items { flex: 1; display: flex; flex-direction: column; padding: 2px 0; }
.start-items .menu-item { padding: 8px 10px; gap: 10px; }
.start-items .menu-item img { width: 24px; height: 24px; flex: none; }

/* ---------- 起動画面 ---------- */
#boot {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  color: #c0c0c0;
  display: grid;
  place-items: center;
  font-size: 14px;
  cursor: pointer;
}
#boot[hidden] { display: none; }
.boot-inner { width: min(360px, 86vw); text-align: center; }
.boot-logo { font-size: 44px; letter-spacing: 6px; color: #fff; line-height: 1; }
.boot-logo small { font-size: 16px; letter-spacing: 2px; display: block; margin-top: 8px; color: #7fd0d0; }
.boot-stones { margin: 22px auto 10px; display: flex; gap: 6px; justify-content: center; }
.boot-stones i { width: 14px; height: 14px; display: block; border-radius: 0; background: #333; animation: bootdot 1.2s steps(1) infinite; }
.boot-stones i:nth-child(odd) { background: #eee; }
.boot-stones i:nth-child(2) { animation-delay: 0.15s; }
.boot-stones i:nth-child(3) { animation-delay: 0.3s; }
.boot-stones i:nth-child(4) { animation-delay: 0.45s; }
.boot-stones i:nth-child(5) { animation-delay: 0.6s; }
@keyframes bootdot { 50% { opacity: 0.15; } }
.boot-msg { font-size: 12px; color: #808080; margin-top: 18px; text-align: left; white-space: pre; min-height: 5em; }

/* トースト (吹き出し型のヒント) */
#balloon {
  position: fixed;
  right: 12px;
  bottom: 44px;
  max-width: 280px;
  background: var(--tooltip);
  border: 1px solid #000;
  padding: 8px 10px;
  font-size: 13px;
  z-index: 250;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}
#balloon::after {
  content: "";
  position: absolute;
  right: 32px;
  bottom: -9px;
  border: 8px solid transparent;
  border-top-color: #000;
  border-bottom: 0;
}
#balloon[hidden] { display: none; }
#balloon b { display: block; margin-bottom: 2px; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 760px) {
  body { overflow-y: auto; }
  #desktop { position: static; min-height: calc(100% - 34px); padding: 6px 4px 44px; }
  .icons { display: none; }
  #main-win {
    position: relative;
    left: auto; top: auto; transform: none;
    width: 100%;
    margin: 0 auto;
  }
  .win-body { grid-template-columns: 1fr; }
  .board-wrap { max-width: 100%; min-width: 0; }
  .side { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
  .side .full { grid-column: 1 / -1; }
  .player { grid-template-columns: 40px 1fr; padding: 4px; }
  .player .avatar { width: 40px; height: 40px; }
  .player .avatar canvas { width: 36px; height: 36px; }
  .btn-grid { grid-template-columns: repeat(3, 1fr); }
  #notepad, #player { left: 4px !important; top: 4px !important; right: auto; }
  .task-btn { flex: 1 1 0; min-width: 0; }
}
@media (max-width: 420px) {
  .statusbar .hide-sm { display: none; }
  .player.turn::after { content: "◀"; }
}
