/* カラーバーツール スタイル */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #000;
  color: #fff;
  overflow: hidden;
}

#app {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

#canvasContainer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 1;
}

#testCanvas {
  display: block;
  cursor: pointer;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#svgDisplay {
  cursor: pointer;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

#controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(26, 26, 26, 0.8);
  padding: 15px;
  border-top: 1px solid rgba(51, 51, 51, 0.8);
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
  z-index: 100;
}

.control-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.control-group label {
  font-size: 12px;
  color: #999;
  margin-right: 5px;
}

button {
  background: #333;
  color: #fff;
  border: 1px solid #555;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

button:hover {
  background: #444;
  border-color: #666;
}

button.active {
  background: #0066cc;
  border-color: #0066cc;
}

button[data-pattern].active,
button[data-aspect].active,
button[data-audio-level].active,
button[data-flat-color].active,
button[data-blink-interval].active {
  background: #0066cc;
  border-color: #0066cc;
}

/* 16:9ボタンを目立たせる */
button.highlight {
  border: 2px solid #ffaa00;
  font-weight: bold;
}

button.highlight.active {
  background: #0066cc;
  border-color: #ffaa00;
}

/* カスタムカラーピッカー */
#customColor {
  width: 50px;
  height: 36px;
  border: 1px solid #555;
  border-radius: 4px;
  cursor: pointer;
  padding: 2px;
  background: #333;
}

#customColor:hover {
  border-color: #666;
}

#fullscreenBtn {
  background: #006600;
  border-color: #008800;
}

#fullscreenBtn:hover {
  background: #008800;
}

/* 音声トグルボタン: デフォルト（OFF）はオレンジ */
#audioToggle {
  background: #cc6600;
  border-color: #cc6600;
}

#audioToggle:hover {
  background: #dd7700;
  border-color: #dd7700;
}

/* 音声ON時は緑 */
#audioToggle.active {
  background: #006600;
  border-color: #008800;
}

#audioToggle.active:hover {
  background: #008800;
  border-color: #009900;
}

/* 点滅ボタン */
#blinkBtn.active {
  background: #cc0000;
  border-color: #cc0000;
}

.divider {
  width: 1px;
  height: 30px;
  background: #444;
}

/* ツールチップ */
[data-tooltip] {
  position: relative;
}

[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  margin-bottom: 5px;
  z-index: 1000;
  pointer-events: none;
}

#disclaimer {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: #ffaa00;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 99;
  text-align: center;
  max-width: 90%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* フルスクリーン時 */
:fullscreen #app {
  width: 100vw;
  height: 100vh;
}

:fullscreen #canvasContainer {
  width: 100vw;
  height: 100vh;
}

:fullscreen #controls {
  z-index: 1000;
  display: none; /* デフォルトは非表示 */
}

:fullscreen #disclaimer {
  bottom: 10px;
}

:-webkit-full-screen #app {
  width: 100vw;
  height: 100vh;
}

:-webkit-full-screen #canvasContainer {
  width: 100vw;
  height: 100vh;
}

:-webkit-full-screen #controls {
  z-index: 1000;
  display: none;
}

:-webkit-full-screen #disclaimer {
  bottom: 10px;
}

:-moz-full-screen #app {
  width: 100vw;
  height: 100vh;
}

:-moz-full-screen #canvasContainer {
  width: 100vw;
  height: 100vh;
}

:-moz-full-screen #controls {
  z-index: 1000;
  display: none;
}

:-moz-full-screen #disclaimer {
  bottom: 10px;
}

/* レスポンシブ */
@media (max-width: 768px) {
  #controls {
    font-size: 11px;
    padding: 10px;
    gap: 10px;
  }

  button {
    padding: 6px 12px;
    font-size: 11px;
  }

  .control-group {
    gap: 5px;
  }
}
