/* ------------------------------
   Hololive Tier Maker - style.css
   ------------------------------ */

:root {
  color-scheme: light;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: "Noto Sans JP", sans-serif;
  background-image: url('images/background.png') !important;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-color: #fff !important; 
  color: #111 !important; 
  display: flex;
  justify-content: center;
  align-items: center; 
  min-height: 100vh;
}

#app {
  max-width: 1000px; 
  margin: 10px auto; 
  padding: 15px;
  background: rgba(255,255,255,0.85) !important;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  width: 98%; 
  max-height: calc(100vh - 40px); 
  overflow-y: auto; 
}

/* 💡 配置モード: 画像が止まったら空き枠をクリックしやすくする */
.placing-mode .placeholder.empty {
  cursor: pointer;
  background: rgba(255, 200, 200, 0.3) !important; /* ほんのり色付けしてアピール */
  border: 2px dashed #ff5959;
}

#start-screen {
  text-align: center;
  padding: 20px;
}

#theme-input-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
  gap: 8px;
}

#start-screen input[type="text"] {
  flex-grow: 1;
  max-width: 60%;
  padding: 10px;
  font-size: 16px;
  border-radius: 6px;
  border: 1px solid #bbb;
  background-color: #fff !important;
  color: #000 !important;
}

#update-theme-btn {
  padding: 10px 15px;
  font-size: 18px;
  height: 40px; 
  display: flex;
  align-items: center;
  justify-content: center;
}

.controls {
  margin-top: 15px;
}

.secondary-controls {
    margin-top: 10px;
}
.secondary-controls button {
    background: #f0f0f0 !important;
    color: #333 !important;
    font-size: 16px;
}

button {
  padding: 10px 20px;
  font-size: 18px;
  cursor: pointer;
  border-radius: 8px;
  border: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.hidden { display: none; }
.hidden-overlay { display: none !important; }

#theme-display {
  margin: 10px 0 10px 0;
  font-size: 20px;
  text-align: left;
}

#random-area {
  display: flex;
  flex-direction: column; /* テキスト表示用に縦並び */
  justify-content: center;
  align-items: center;
  margin-bottom: 20px; 
}

#instruction-text {
  margin-top: 10px;
  font-weight: bold;
  color: #d32f2f !important;
}

/* 画像を囲むボックス */
#random-box {
  width: 260px;
  height: 260px;
  border: 3px solid #222;
  background: white !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

/* 背景画像を表示する要素 */
#random-image-panel {
  width: 100%;
  height: 100%;
  background-color: white !important;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

#tiers-wrap { 
    margin-top: 10px; 
}

#tiers {
  width: 100%;
  margin: 0 auto;
}

.tier-row {
  display: flex;
  align-items: center;
  margin: 5px 0; 
  background: rgba(255,255,255,0.8) !important;
  padding: 8px;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.tier-label {
  width: 70px;
  color: white !important;
  font-size: 20px;
  font-weight: 700;
  padding: 10px; 
  border-radius: 6px;
  text-align: center;
  margin-right: 12px;
}

.s { background: #ff5959 !important; }
.a { background: #ffa559 !important; color: #111 !important; }
.b { background: #ffe15d !important; color: #111 !important; }
.c { background: #59ffa7 !important; color: #111 !important; }
.d { background: #59b0ff !important; color: #111 !important; }

.slot {
  flex-grow: 1;
  display: flex;
  gap: 4px; 
  align-items: center;
  padding: 4px;
  flex-wrap: wrap;
}

.placeholder {
  width: 80px; 
  height: 80px; 
  border: 2px solid #000;
  background: rgba(255,255,255,0.9) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.placeholder.empty {
  background: rgba(255,255,255,0.6) !important;
}

.placeholder img {
  width: 78px; 
  height: 78px; 
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

/* ポップアップ */
#overlay, #settings-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.65) !important;
  display: none; 
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#popup, #settings-popup {
  background: #fff !important;
  padding: 26px 30px;
  border-radius: 12px;
  text-align: center;
  max-width: 90%;
  color: #333 !important;
}
#settings-popup {
    width: 600px; 
}

#settings-popup h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    color: #333 !important;
}

#image-category-selection {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin: 10px 0 20px 0;
}
#image-category-selection label {
    font-size: 16px;
    cursor: pointer;
    background: #eee !important;
    color: #333 !important;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background 0.2s;
}
#image-category-selection label:has(input:checked) {
    background: #59b0ff !important;
    color: white !important;
}
#image-category-selection input[type="checkbox"] {
    margin-right: 5px;
}

#tier-limit-controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px 30px;
    margin: 10px 0 20px 0; 
    padding: 10px 0;
}
.tier-limit-group {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 16px;
}
#tier-limit-controls input[type="number"] {
    width: 50px;
    padding: 5px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff !important;
    color: #333 !important;
}

.popup-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.popup-actions button {
  margin: 8px;
  padding: 10px 18px;
  font-size: 16px;
}

.hint {
  margin-top: 12px;
  color: #444 !important;
  font-size: 14px;
}