/* =====================================================================
   RGB: texto, prévia e barra em cima; cores, código e prontos lado a lado
   ===================================================================== */
.rgb-head .wrap { padding-block: clamp(22px, 3vw, 34px) clamp(26px, 3.4vw, 38px); gap: 6px; }
.rgb-head h1 { font-size: clamp(28px, 4vw, 40px); }
.rgb-head p { font-size: 16px; color: var(--muted); }
.rgb-section { padding-block: clamp(18px, 2.6vw, 28px) clamp(44px, 6vw, 72px); }
.rgb-app { display: grid; gap: 16px; }
.rgb-panel { display: grid; align-content: start; gap: 14px; min-width: 0; padding: clamp(14px, 1.8vw, 20px); background: var(--plate); border: 2px solid var(--line); }
.rgb-cols { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.3fr) minmax(0, .85fr); gap: 16px; align-items: start; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; }
.panel-head h2 { font-size: 20px; }
.tool-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-row .btn { margin-bottom: 4px; flex: 1 1 auto; padding-inline: 8px; }

/* texto e estilos */
.text-row { display: flex; align-items: stretch; gap: 8px; }
.text-row .input { flex: 1 1 auto; min-width: 0; }
.text-row .icon-btn { width: 56px; height: 56px; }
.input-lg { min-height: 56px; font-size: 18px; }
.toggles { display: flex; gap: 4px; flex: none; }
.toggle {
  width: 46px; height: 56px; padding: 0; font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--text-2);
  background: var(--plate-2); border: 2px solid var(--line-2);
  transition: border-color .15s, color .15s, background-color .15s;
}
.toggle:hover { border-color: var(--yellow); color: var(--yellow); }
.toggle[aria-pressed="true"] { color: #1A0E06; background: var(--orange); border-color: #C9661C; }

/* prévia no estilo do chat do jogo */
.mc-preview {
  --bg: linear-gradient(180deg, #4a7fd6 0%, #9cc4ff 58%, #5e9e3a 58%, #4a7d2e 100%);
  position: relative; display: flex; align-items: flex-end; min-height: 128px; padding: 12px;
  background: var(--bg); border: 2px solid #000;
}
.mc-preview.bg-dark { --bg: #0d0a09; }
.mc-preview.bg-light { --bg: #e9e4dc; }
.mc-preview.bg-nether { --bg: linear-gradient(180deg, #3a0b0b, #7a1b14); }
.mc-chat { width: 100%; padding: 10px 12px; background: rgba(0, 0, 0, .55); }
.mc-preview.bg-light .mc-chat { background: rgba(0, 0, 0, .08); }
.mc-line { font-family: var(--pixel); font-weight: 400; font-variant-ligatures: none; font-size: clamp(18px, 2.6vw, 28px); line-height: 1.35; color: #fff; word-break: break-word; white-space: pre-wrap; min-height: 1.35em; }
.mc-line span { text-shadow: 2px 2px 0 var(--sh, #3f3f3f); }
.mc-line .b { font-weight: 700; }
.mc-line .i { font-style: italic; }
.mc-line .u { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.mc-line .s { text-decoration: line-through; text-decoration-thickness: 2px; }
.mc-line .u.s { text-decoration: underline line-through; }
.bg-picker { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.bg-picker button { width: 26px; height: 26px; padding: 0; border: 2px solid rgba(0,0,0,.6); }
.bg-picker button[aria-pressed="true"] { outline: 2px solid #fff; outline-offset: 1px; }

/* barra de degradê: as marcas ficam em cima dela e passam um pouco das pontas */
.ramp { display: grid; gap: 8px; padding-inline: 13px; }
.ramp-track { position: relative; height: 30px; background: var(--plate-3); border: 2px solid #000; cursor: copy; touch-action: none; user-select: none; }
.ramp-h {
  position: absolute; top: -8px; width: 26px; height: 42px; padding: 0; transform: translateX(-50%);
  background: var(--c, #fff); border: 2px solid #000; box-shadow: inset 0 0 0 2px #fff; cursor: grab; touch-action: none;
}
.ramp-h:hover { box-shadow: inset 0 0 0 2px var(--yellow); }
.ramp-h.on { box-shadow: inset 0 0 0 3px var(--yellow); z-index: 2; }
.ramp-h:active { cursor: grabbing; }
.ramp-hint { margin-inline: -13px; padding-top: 8px; font-size: 14px; color: var(--muted); }

/* cores */
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper .icon-btn { width: 40px; height: 40px; }
.stepper .icon-btn:disabled { opacity: .35; cursor: default; border-color: var(--line-2); color: var(--text); }
.stepper output { min-width: 28px; text-align: center; font-family: var(--display); font-weight: 700; }
.stops { list-style: none; display: grid; gap: 8px; }
.stop { display: grid; grid-template-columns: 44px minmax(0, 1fr) 70px 40px; align-items: center; gap: 6px; padding: 6px; background: var(--plate-2); border: 2px solid var(--line); }
.stop.on { border-color: var(--orange); }
.swatch { width: 44px; height: 40px; padding: 0; background: var(--c, #fff); border: 2px solid #000; box-shadow: inset 0 0 0 2px rgba(255,255,255,.28); }
.swatch:hover { box-shadow: inset 0 0 0 2px var(--yellow); }
.stop .input { min-height: 40px; padding: 6px 8px; font-family: var(--code); font-weight: 500; font-size: 14px; }
.stop [data-hex] { text-transform: uppercase; }
.pos { position: relative; display: block; }
.pos .input { padding-right: 20px; -moz-appearance: textfield; appearance: textfield; }
.pos .input::-webkit-inner-spin-button, .pos .input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pos::after { content: "%"; position: absolute; right: 7px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }
.stop .icon-btn { width: 40px; height: 40px; border: 0; background: transparent; color: var(--muted); }
.stop .icon-btn:hover { color: var(--red); }
.stop .icon-btn:disabled { opacity: .3; cursor: default; color: var(--muted); }

/* seletor de cor: abre embaixo da linha da cor */
.picker { display: grid; gap: 10px; padding: 10px; background: var(--bg); border: 2px solid var(--orange); }
.sv { position: relative; height: 150px; border: 2px solid #000; cursor: crosshair; touch-action: none; background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent), var(--hue, #f00); }
.sv-thumb { position: absolute; width: 16px; height: 16px; transform: translate(-50%, -50%); border: 2px solid #fff; box-shadow: 0 0 0 2px #000; pointer-events: none; }
.hue { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 22px; margin: 0; border: 2px solid #000; background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); cursor: pointer; }
.hue::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 24px; background: #fff; border: 2px solid #000; }
.hue::-moz-range-thumb { width: 8px; height: 18px; background: #fff; border: 2px solid #000; border-radius: 0; }

/* código */
.where { font-size: 14px; line-height: 1.45; color: var(--muted); }
.where strong { color: var(--text-2); font-weight: 700; }
.where .note { display: block; margin-top: 4px; color: var(--yellow); }
.textarea { min-height: 128px; font-family: var(--code); font-weight: 500; font-size: 14px; line-height: 1.5; word-break: break-all; resize: vertical; }
.counter { font-size: 14px; color: var(--muted); }
.counter.warn { color: #FF8A8C; font-weight: 700; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 36px; cursor: pointer; color: var(--text-2); font-size: 15px; }
.check input { width: 20px; height: 20px; accent-color: var(--orange); }

/* mais opções */
.more { border: 2px solid var(--line); background: var(--plate-2); }
.more summary { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px; cursor: pointer; font-weight: 700; color: var(--text-2); list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "+"; font-family: var(--display); font-weight: 700; color: var(--orange); width: 14px; }
.more[open] summary::before { content: "−"; }
.more summary:hover { color: var(--text); }
.more-body { display: grid; gap: 14px; padding: 4px 14px 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* prontos */
.presets-title { margin-bottom: 8px; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.preset-wrap { position: relative; display: grid; }
.preset {
  display: grid; gap: 6px; width: 100%; min-height: 54px; padding: 6px 6px 8px; text-align: left;
  font: 600 13.5px/1.2 var(--body); color: var(--text-2); background: var(--plate-2); border: 2px solid var(--line);
  overflow-wrap: anywhere;
}
.preset:hover, .preset[aria-pressed="true"] { border-color: var(--orange); color: var(--text); }
.preset .sw { display: block; height: 14px; border: 1px solid #000; }
.preset-del { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; color: var(--text); background: var(--plate-3); border: 2px solid var(--line-2); }
.preset-del svg { width: 13px; height: 13px; }
.preset-del:hover { color: var(--red); border-color: var(--red); }

/* telas menores */
@media (max-width: 1080px) {
  .rgb-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rgb-cols > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .rgb-cols { grid-template-columns: minmax(0, 1fr); }
  .text-row { flex-wrap: wrap; }
  .text-row .input { flex-basis: 100%; }
  .toggles { flex: 1 1 auto; }
  .toggle { flex: 1 1 0; width: auto; height: 46px; }
  .text-row .icon-btn { width: 46px; height: 46px; }
  .mc-preview { min-height: 112px; }
}
@media (max-width: 380px) {
  .stop { grid-template-columns: 40px minmax(0, 1fr) 62px 34px; gap: 4px; }
  .swatch { width: 40px; }
  .stop .icon-btn { width: 34px; }
  .two { grid-template-columns: 1fr; }
}
