/* Suminigashi — оформление страницы. Цвета и токены берём из styles.css. */

html.page-sumini,
html.page-sumini body {
  height: 100%;
}

.page-suminigashi {
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #efeae0;
}

.page-suminigashi .site-header {
  flex: 0 0 auto;
  background: rgba(4, 28, 43, .98);
}

/* Сцена: всё, что ниже шапки. Полотно живёт внутри неё. */
.ink-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #efeae0;
}

.page-suminigashi main.ink-stage {
  display: block;
}

#water {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

#water[data-tool="comb"] { cursor: grab; }

/* --------------------------------------------------------------- подсказка */

.ink-hint {
  position: absolute;
  left: 50%;
  top: 12%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 15px;
  font-style: italic;
  letter-spacing: .06em;
  color: rgba(20, 24, 29, .34);
  pointer-events: none;
  transition: opacity 1.1s ease;
  white-space: nowrap;
}

.ink-hint.is-gone { opacity: 0; }

/* ------------------------------------------------------------------ панель */

.ink-dock {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(452px, calc(100% - 24px));
  padding: 14px 16px 15px;
  border: 1px solid var(--gold-soft);
  border-radius: 18px;
  background: rgba(6, 31, 48, .93);
  box-shadow: 0 24px 48px -28px rgba(0, 0, 0, .65);
  backdrop-filter: blur(16px) saturate(1.05);
  -webkit-backdrop-filter: blur(16px) saturate(1.05);
  color: var(--ivory);
  font-size: 13px;
}

.ink-dock.is-closed { width: auto; padding: 10px 44px 10px 16px; }
.ink-dock.is-closed .ink-dock-body { display: none; }

.ink-collapse {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(245, 239, 217, .45);
  cursor: pointer;
}

.ink-collapse:hover { background: rgba(245, 239, 217, .08); color: var(--ivory); }

.ink-collapse::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.ink-dock.is-closed .ink-collapse::before { transform: rotate(-135deg); margin-top: 3px; }

.ink-dock-body { display: grid; gap: 13px; }

.ink-row { display: flex; align-items: center; gap: 8px; }

/* -------------------------------------------------------------- инструменты */

.ink-tools {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(245, 239, 217, .07);
}

.ink-tool {
  padding: 7px 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(245, 239, 217, .62);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background .22s ease, color .22s ease;
}

.ink-tool:hover { color: var(--ivory); }

.ink-tool.is-active {
  background: var(--gold);
  color: var(--night-deep);
}

/* ------------------------------------------------------------------ чернила */

.ink-row--inks { gap: 10px; }

.ink-swatch {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .18) inset, 0 1px 2px rgba(0, 0, 0, .3);
  transition: transform .2s ease, box-shadow .2s ease;
}

.ink-swatch:hover { transform: translateY(-1px); }

.ink-swatch.is-active {
  box-shadow:
    0 0 0 2px var(--night),
    0 0 0 3.5px var(--gold);
}

.ink-palette {
  margin-left: auto;
  padding: 6px 10px;
  border: 1px solid var(--gold-soft);
  border-radius: 999px;
  background: transparent;
  color: rgba(245, 239, 217, .7);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}

.ink-palette:hover { color: var(--ivory); border-color: var(--gold); }

/* ----------------------------------------------------------------- ползунки */

.ink-row--sliders { display: grid; gap: 2px; }

.ink-slider {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.ink-slider span {
  font-size: 11px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: rgba(245, 239, 217, .55);
}

.ink-slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.ink-slider input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 2px;
  background: rgba(245, 239, 217, .25);
}

.ink-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--gold);
}

.ink-slider input[type="range"]::-moz-range-track {
  height: 2px;
  border-radius: 2px;
  background: rgba(245, 239, 217, .25);
}

.ink-slider input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: var(--gold);
}

/* ------------------------------------------------------------------- кнопки */

.ink-actions { gap: 8px; }

.ink-act {
  flex: 1;
  padding: 9px 4px;
  border: 1px solid var(--gold-soft);
  border-radius: 11px;
  background: transparent;
  color: var(--ivory);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease, opacity .2s ease;
}

.ink-act:hover:not(:disabled) {
  background: rgba(245, 239, 217, .08);
  border-color: var(--gold);
}

.ink-act:disabled { opacity: .34; cursor: default; }

.ink-act.is-active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--night-deep);
}

.ink-act--primary {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--night-deep);
}

.ink-act--primary:hover:not(:disabled) {
  background: var(--ivory);
  border-color: var(--ivory);
}

/* ------------------------------------------------------------------ фолбэк */

.ink-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 32px;
  background: #efeae0;
  text-align: center;
  color: #1a1c1f;
}

.ink-fallback[hidden] { display: none; }

.ink-fallback h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 400;
  color: #1a1c1f;
}

.ink-fallback p {
  max-width: 46ch;
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(20, 24, 29, .62);
}

.ink-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.ink-dock button:focus-visible,
.ink-dock input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

@media (max-width: 560px) {
  .ink-dock { padding: 12px 13px 13px; border-radius: 16px; }
  .ink-slider { grid-template-columns: 78px 1fr; gap: 10px; }
  .ink-tool { font-size: 12.5px; padding: 7px 4px; }
  .ink-act { font-size: 12.5px; }
  .ink-palette { font-size: 10.5px; padding: 5px 7px; }
  .ink-hint { font-size: 14px; }
}

@media (max-height: 620px) {
  .ink-row--inks { display: none; }
}
