/* @pbth/event-krathong-ui stylesheet — 100% local offline fonts & glassmorphic river studio */
@font-face {
  font-family: "Noto Sans Thai";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../../assets/fonts/f196b1e65fee88ed-s.p.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Serif Thai";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../../assets/fonts/faa5e7410e7c1c5d-s.p.woff2") format("woff2");
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../../assets/fonts/8760c4774489e4ba-s.p.woff2") format("woff2");
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../../assets/fonts/7b89a4fd5e90ede0-s.p.woff2") format("woff2");
}
@font-face {
  font-family: "Sriracha";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../../assets/fonts/58da5655a32e217e-s.woff2") format("woff2");
}

:root {
  --kr-ink: #faf5eb;
  --kr-muted: rgba(250, 245, 235, 0.72);
  --kr-faint: rgba(250, 245, 235, 0.48);
  --kr-gold: #e7be6a;
  --kr-gold-deep: #c49238;
  --kr-bg: #0c101b;
  --kr-glass: rgba(15, 20, 34, 0.72);
  --kr-glass-strong: rgba(13, 17, 30, 0.88);
  --kr-border: rgba(255, 233, 185, 0.22);
  --kr-border-strong: rgba(231, 190, 106, 0.56);
  --kr-danger: #d46b65;
  --kr-font-sans: "Manrope", "Noto Sans Thai", system-ui, -apple-system, sans-serif;
  --kr-font-serif: "Cormorant Garamond", "Noto Serif Thai", Georgia, serif;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--kr-bg);
  color: var(--kr-ink);
  font-family: var(--kr-font-sans);
  -webkit-font-smoothing: antialiased;
}

.kr-shell {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#kr-canvas-host {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: radial-gradient(circle at 50% 35%, #232842 0%, #0d121f 68%, #070a12 100%);
}

#kr-canvas-host canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  cursor: grab;
}

#kr-canvas-host canvas:active {
  cursor: grabbing;
}

/* Header & top controls */
.kr-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  pointer-events: none;
}

.kr-header > * {
  pointer-events: auto;
}

.kr-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--kr-glass);
  border: 1px solid var(--kr-border);
  backdrop-filter: blur(14px);
  border-radius: 999px;
  padding: 6px 14px 6px 8px;
}

.kr-brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.kr-brand-title {
  font-family: var(--kr-font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--kr-gold);
  line-height: 1.1;
}

.kr-brand-count {
  font-size: 12px;
  color: var(--kr-muted);
}

.kr-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.kr-pill-group {
  display: inline-flex;
  background: var(--kr-glass);
  border: 1px solid var(--kr-border);
  backdrop-filter: blur(14px);
  border-radius: 999px;
  padding: 3px;
  gap: 3px;
}

.kr-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--kr-muted);
  font-family: var(--kr-font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.16s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.kr-btn:hover {
  color: var(--kr-ink);
  background: rgba(255, 255, 255, 0.08);
}

.kr-btn.is-active {
  color: #1c1507;
  background: linear-gradient(135deg, #f3d284, var(--kr-gold-deep));
  border-color: rgba(255, 240, 198, 0.6);
}

.kr-btn-glass {
  background: var(--kr-glass);
  border: 1px solid var(--kr-border);
  color: var(--kr-ink);
  backdrop-filter: blur(14px);
}

.kr-btn-primary {
  background: linear-gradient(135deg, #f5d88f 0%, #c89135 100%);
  color: #1f1606;
  border: 1px solid rgba(255, 242, 206, 0.7);
  box-shadow: 0 6px 24px rgba(212, 162, 72, 0.32);
}

.kr-btn-primary:hover {
  filter: brightness(1.06);
  color: #1f1606;
}

.kr-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Location Strip / River Info Banner */
.kr-location-banner {
  position: relative;
  z-index: 9;
  margin: 0 auto auto;
  text-align: center;
  background: rgba(12, 16, 28, 0.55);
  border: 1px solid var(--kr-border);
  backdrop-filter: blur(10px);
  padding: 8px 18px;
  border-radius: 14px;
  max-width: 92vw;
  pointer-events: auto;
}

.kr-location-banner h2 {
  font-family: var(--kr-font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--kr-gold);
}

.kr-location-banner p {
  font-size: 12px;
  color: var(--kr-muted);
  margin-top: 2px;
}

/* Bottom Studio Dock */
.kr-dock-wrap {
  position: relative;
  z-index: 12;
  width: 100%;
  max-width: 960px;
  margin: 0 auto 14px;
  padding: 0 12px;
  pointer-events: none;
}

.kr-dock {
  pointer-events: auto;
  background: var(--kr-glass-strong);
  border: 1px solid var(--kr-border);
  backdrop-filter: blur(20px);
  border-radius: 22px;
  padding: 12px 14px 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.48);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kr-step-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.kr-steps {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.kr-tools-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Horizontal Card Trays */
.kr-tray {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(231, 190, 106, 0.35) transparent;
}

.kr-card {
  flex: 0 0 auto;
  width: 92px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 7px 6px;
  color: var(--kr-ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
  text-align: center;
}

.kr-card:hover {
  transform: translateY(-2px);
  border-color: rgba(231, 190, 106, 0.5);
  background: rgba(255, 255, 255, 0.09);
}

.kr-card.is-selected {
  border-color: var(--kr-gold);
  background: rgba(231, 190, 106, 0.16);
}

.kr-card-thumb {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 10px;
}

.kr-card-loc {
  width: 126px;
  padding: 6px;
}

.kr-card-loc img {
  width: 112px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
}

.kr-card-label {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--kr-ink);
}

.kr-card-sub {
  font-size: 10px;
  color: var(--kr-faint);
}

/* Swatches & Part Controls */
.kr-subrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.kr-swatches {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kr-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: transform 0.14s ease;
}

.kr-swatch.is-selected {
  border-color: #ffffff;
  transform: scale(1.16);
  box-shadow: 0 0 0 2px var(--kr-gold);
}

/* Wish Form */
.kr-wish-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 10px;
  align-items: end;
}

.kr-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kr-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--kr-gold);
}

.kr-input,
.kr-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--kr-border);
  border-radius: 12px;
  color: var(--kr-ink);
  font-family: var(--kr-font-sans);
  font-size: 13.5px;
  padding: 9px 11px;
  outline: none;
}

.kr-textarea {
  min-height: 62px;
  max-height: 110px;
  resize: vertical;
}

.kr-input:focus,
.kr-textarea:focus {
  border-color: var(--kr-gold);
  background: rgba(255, 255, 255, 0.1);
}

/* River Feed Strip + Inspected Wish Card */
.kr-river-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kr-wish-card-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--kr-border);
  border-radius: 14px;
  padding: 10px 14px;
}

.kr-wish-quote {
  font-family: "Sriracha", var(--kr-font-serif);
  font-size: 15px;
  color: var(--kr-ink);
  line-height: 1.4;
}

.kr-wish-author {
  font-size: 12px;
  color: var(--kr-gold);
  margin-top: 3px;
}

/* Modal + Toast */
.kr-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(6, 9, 16, 0.72);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.kr-modal {
  width: min(440px, 100%);
  background: #131826;
  border: 1px solid var(--kr-border-strong);
  border-radius: 20px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.kr-modal h3 {
  font-family: var(--kr-font-serif);
  font-size: 19px;
  color: var(--kr-gold);
}

.kr-toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  background: rgba(20, 26, 42, 0.94);
  border: 1px solid var(--kr-gold);
  color: var(--kr-ink);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.kr-hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .kr-header {
    padding: 10px 12px;
  }
  .kr-wish-grid {
    grid-template-columns: 1fr;
  }
  .kr-card {
    width: 82px;
  }
}
