/* ==========================================================================
   PÏCASSO: ATELIER PAPIER COLLÉ & DORA MAAR (1912 - 1937 - 2026)
   Tactile Cubist Collage, Spanish Flamenco & Wallpaper Foundry
   ========================================================================== */

:root {
  /* Dora Maar & Mediterranean Palette */
  --c-vermilion: #D92525;
  --c-emerald: #0F8A5F;
  --c-citron: #F2C94C;
  --c-terracotta: #C85A17;
  --c-ochre: #C08A4E;
  --c-ultramarine: #1848A0;
  --c-charcoal: #141416;
  --c-kraft: #E8DEC8;
  --c-newsprint: #EAE3D2;
  --c-parchment: #F7F3E8;

  /* Interface */
  --ground-bg: var(--c-kraft);
  --border-color: #1A1A1E;
  --text-main: #141416;
  --text-muted: #555555;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', sans-serif;
  --font-display: 'Syne', sans-serif;
  --font-serif: 'Instrument Serif', serif;
  --font-editorial: 'Playfair Display', serif;
  --font-mono: 'Space Mono', monospace;
}

/* Periods Theme Variations */
body.period-dora-maar {
  --ground-bg: #EADFC9;
  background-color: #D6C9B0;
}

body.period-synthetic-collage {
  --ground-bg: #E2D7C0;
  background-color: #CCBF9E;
}

body.period-iberian-mask {
  --ground-bg: #CFA47E;
  background-color: #B5845B;
  --border-color: #2D1A10;
}

body.period-blue-period {
  --ground-bg: #0F172A;
  background-color: #0A0F1D;
  --border-color: #1E293B;
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
}

body.period-guernica-stark {
  --ground-bg: #111215;
  background-color: #08080A;
  --border-color: #2A2C33;
  --text-main: #FFFFFF;
  --text-muted: #9CA3AF;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #D6C9B0;
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   HEADER NAVIGATION
   ========================================================================== */

.studio-header {
  height: 64px;
  width: 100%;
  background: #FFFFFF;
  border-bottom: 3px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  position: relative;
}

body.period-blue-period .studio-header,
body.period-guernica-stark .studio-header {
  background: #111827;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.picasso-avatar {
  width: 38px;
  height: 38px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  background: var(--c-parchment);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 0px var(--border-color);
  overflow: hidden;
}

.avatar-svg {
  width: 32px;
  height: 32px;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.edition-badge {
  font-size: 0.65rem;
  background: var(--c-terracotta);
  color: #FFF;
  padding: 2px 6px;
  font-weight: 800;
  border: 1.5px solid var(--border-color);
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: -3px;
}

.mode-toggles {
  display: flex;
  background: #ECE3CF;
  padding: 4px;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  gap: 4px;
}

body.period-blue-period .mode-toggles,
body.period-guernica-stark .mode-toggles {
  background: #1F2937;
}

.mode-btn {
  border: none;
  background: transparent;
  padding: 7px 14px;
  border-radius: 5px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #444;
  transition: all 0.15s ease;
}

body.period-blue-period .mode-btn,
body.period-guernica-stark .mode-btn {
  color: #CBD5E1;
}

.mode-btn:hover {
  background: rgba(255, 255, 255, 0.6);
  color: #000;
}

.mode-btn.active {
  background: #141416;
  color: #FFF;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

body.period-blue-period .mode-btn.active {
  background: #2563EB;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  border: 2px solid var(--border-color);
  background: #FFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 2px 2px 0px var(--border-color);
  transition: all 0.15s ease;
}

body.period-blue-period .btn-icon,
body.period-guernica-stark .btn-icon {
  background: #1F2937;
  color: #FFF;
}

.btn-icon:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px var(--border-color);
}

.btn-pill {
  padding: 8px 18px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--border-color);
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--c-vermilion);
  color: #FFF;
  box-shadow: 3px 3px 0px var(--border-color);
}

.btn-primary:hover {
  background: #bd1c1c;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0px var(--border-color);
}

.btn-secondary {
  background: #FFF;
  color: #111;
  box-shadow: 3px 3px 0px var(--border-color);
}

body.period-blue-period .btn-secondary,
body.period-guernica-stark .btn-secondary {
  background: #1F2937;
  color: #FFF;
}

/* ==========================================================================
   WORKSPACE GRID
   ========================================================================== */

.studio-workspace {
  display: grid;
  grid-template-columns: 250px 1fr 310px;
  height: calc(100vh - 64px);
  width: 100%;
  position: relative;
  background-color: #CFC2A7;
}

body.period-blue-period .studio-workspace {
  background-color: #070D18;
}

body.period-guernica-stark .studio-workspace {
  background-color: #08080A;
}

/* ==========================================================================
   LEFT TOOLBAR: TACTILE COLLAGE & ANATOMICAL FACETS
   ========================================================================== */

.palette-dock {
  background: #FFFFFF;
  border-right: 2.5px solid var(--border-color);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  z-index: 20;
}

body.period-blue-period .palette-dock,
body.period-guernica-stark .palette-dock {
  background: #111827;
}

.dock-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dock-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #555;
}

body.period-blue-period .dock-tag,
body.period-guernica-stark .dock-tag {
  color: #94A3B8;
}

/* 3-column Collage Spawner Grid */
.facet-spawn-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.spawn-btn {
  padding: 8px 6px;
  background: #F8F5EC;
  border: 1.5px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  transition: all 0.15s ease;
  box-shadow: 1.5px 1.5px 0px var(--border-color);
}

body.period-blue-period .spawn-btn,
body.period-guernica-stark .spawn-btn {
  background: #1F2937;
  color: #FFF;
}

.spawn-btn:hover {
  background: #FFF;
  transform: translate(-1px, -1px);
  box-shadow: 2.5px 2.5px 0px var(--c-vermilion);
  border-color: var(--c-vermilion);
}

/* Unique Icon Visuals for Spawner */
.icon-eye-front {
  width: 22px;
  height: 12px;
  border: 2px solid #111;
  border-radius: 50%;
  background: radial-gradient(circle, #0F8A5F 45%, #FFF 50%);
}

.icon-eye-weep {
  width: 14px;
  height: 20px;
  border-right: 3px solid #111;
  border-bottom: 3px solid #1848A0;
}

.icon-nose-dual {
  width: 14px;
  height: 20px;
  border-left: 3px solid #111;
  border-bottom: 3px solid #111;
}

.icon-lips-teeth {
  width: 22px;
  height: 12px;
  background: var(--c-vermilion);
  border: 1.5px solid #111;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-lips-teeth::after {
  content: '|||';
  font-size: 8px;
  color: #FFF;
  font-weight: 900;
  letter-spacing: -1px;
}

.icon-hat {
  width: 22px;
  height: 12px;
  background: var(--c-citron);
  border: 2px solid #111;
  border-radius: 12px 12px 0 0;
  position: relative;
}

.icon-hat::after {
  content: '🪶';
  font-size: 8px;
  position: absolute;
  top: -8px;
  right: -2px;
}

.icon-newspaper {
  width: 20px;
  height: 16px;
  background: #EAE3D2;
  border: 1px dashed #111;
  background-image: repeating-linear-gradient(#555, #555 1px, transparent 1px, transparent 3px);
}

.icon-music {
  width: 20px;
  height: 16px;
  background: #FFF;
  border: 1px solid #111;
  background-image: repeating-linear-gradient(#111, #111 1px, transparent 1px, transparent 3px);
}

.icon-wood {
  width: 20px;
  height: 16px;
  background: repeating-linear-gradient(45deg, #C08A4E, #C08A4E 2px, #8A5A2B 3px, #C08A4E 4px);
  border: 1px solid #111;
}

.icon-mariniere {
  width: 20px;
  height: 16px;
  background: repeating-linear-gradient(0deg, #1848A0, #1848A0 3px, #FFF 3px, #FFF 6px);
  border: 1px solid #111;
}

.icon-guitar {
  width: 20px;
  height: 16px;
  border-radius: 4px 10px 10px 4px;
  background: var(--c-ochre);
  border: 1.5px solid #111;
}

.icon-card {
  width: 14px;
  height: 20px;
  background: #FFF;
  border: 1px solid #111;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 900;
  color: #D92525;
}

.icon-card::after { content: '♥'; }

.icon-pipe {
  width: 20px;
  height: 12px;
  border-bottom: 3px solid #111;
  border-right: 3px solid #111;
  border-radius: 0 0 10px 0;
}

.dock-divider {
  height: 1.5px;
  background: #DDD4BF;
  margin: 2px 0;
}

body.period-blue-period .dock-divider,
body.period-guernica-stark .dock-divider {
  background: #1F2937;
}

/* Period Buttons */
.period-button-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.period-btn {
  padding: 6px 8px;
  background: #F8F5EC;
  border: 1.5px solid var(--border-color);
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

body.period-blue-period .period-btn,
body.period-guernica-stark .period-btn {
  background: #1F2937;
  color: #FFF;
}

.period-btn.active {
  background: #141416;
  color: #FFF;
  box-shadow: 2px 2px 0px var(--c-vermilion);
}

body.period-blue-period .period-btn.active {
  background: #2563EB;
}

/* Color swatches */
.swatches-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.swatch-btn {
  aspect-ratio: 1;
  border-radius: 5px;
  border: 2px solid var(--border-color);
  background: var(--c);
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 2px 2px 0px rgba(0,0,0,0.8);
}

.swatch-btn:hover {
  transform: scale(1.08);
}

.swatch-btn.active {
  outline: 3px solid #000;
  outline-offset: 2px;
  transform: scale(1.1);
  box-shadow: 3px 3px 0px var(--c-vermilion);
}

/* Custom Color Picker: Any Shape Any Color */
.custom-color-picker-box {
  background: #F8F5EB;
  border: 1.5px solid var(--border-color);
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

body.period-blue-period .custom-color-picker-box,
body.period-guernica-stark .custom-color-picker-box {
  background: #1F2937;
  color: #FFF;
}

.custom-color-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.styled-color-input {
  -webkit-appearance: none;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  width: 38px;
  height: 32px;
  padding: 0;
  cursor: pointer;
  background: transparent;
}

.styled-color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.styled-color-input::-webkit-color-swatch {
  border: none;
  border-radius: 2px;
}

.color-hex-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  background: #FFF;
  border: 1px solid var(--border-color);
  padding: 4px 8px;
  border-radius: 4px;
  color: #111;
  flex: 1;
  text-align: center;
}

/* Selected facet controls */
.selected-facet-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #F8F5EB;
  padding: 8px;
  border-radius: 6px;
  border: 1.5px solid var(--border-color);
}

body.period-blue-period .selected-facet-controls,
body.period-guernica-stark .selected-facet-controls {
  background: #1F2937;
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  font-weight: 600;
  color: #555;
}

body.period-blue-period .slider-header,
body.period-guernica-stark .slider-header {
  color: #94A3B8;
}

input[type="range"] {
  accent-color: var(--c-vermilion);
  cursor: pointer;
}

.button-row {
  display: flex;
  gap: 4px;
}

.btn-action-small {
  flex: 1;
  padding: 6px 4px;
  background: #FFF;
  border: 1.5px solid var(--border-color);
  border-radius: 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.68rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

body.period-blue-period .btn-action-small,
body.period-guernica-stark .btn-action-small {
  background: #2D3748;
  color: #FFF;
}

.btn-action-small:hover {
  background: #FEE7E6;
  border-color: var(--c-vermilion);
  color: var(--c-vermilion);
}

.styled-select {
  width: 100%;
  padding: 7px;
  border: 2px solid var(--border-color);
  border-radius: 5px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  background: #FFF;
  cursor: pointer;
  outline: none;
}

body.period-blue-period .styled-select,
body.period-guernica-stark .styled-select {
  background: #1F2937;
  color: #FFF;
}

.btn-clear {
  margin-top: auto;
  padding: 8px;
  background: #FFF;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 2px 2px 0px var(--border-color);
}

body.period-blue-period .btn-clear,
body.period-guernica-stark .btn-clear {
  background: #1F2937;
  color: #FFF;
}

.btn-clear:hover {
  background: #FEE7E6;
  border-color: var(--c-vermilion);
  color: var(--c-vermilion);
}

/* ==========================================================================
   CENTER ARTBOARD STAGE
   ========================================================================== */

.stage-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  background: radial-gradient(#BEB39D 1.5px, transparent 1.5px), #D5C8AF;
  background-size: 24px 24px;
}

body.period-blue-period .stage-container {
  background: radial-gradient(#1E293B 1.5px, transparent 1.5px), #070D18;
  background-size: 24px 24px;
}

body.period-guernica-stark .stage-container {
  background: radial-gradient(#262626 1.5px, transparent 1.5px), #08080A;
  background-size: 24px 24px;
}

.canvas-aspect-wrapper {
  width: min(92%, 880px);
  height: min(80vh, 660px);
  background: var(--ground-bg);
  border: 12px solid var(--border-color);
  box-shadow: 16px 22px 50px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
  user-select: none;
  transition: background-color 0.3s ease;
}

.picasso-stage {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* Background Head / Bust Armature Silhouette */
.armature-background-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0.9;
}

.armature-svg {
  width: 100%;
  height: 100%;
}

.stage-collage-surface {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
}

/* Realistic Heavy Canvas & Coarse Linen Overlay */
.canvas-linen-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  z-index: 15;
}

/* ==========================================================================
   DRAGGABLE TACTILE PAPIER COLLÉ FRAGMENTS
   ========================================================================== */

.p-collage-item {
  position: absolute;
  cursor: grab;
  transform-origin: center center;
  transition: box-shadow 0.15s ease;
  filter: drop-shadow(4px 8px 12px rgba(0, 0, 0, 0.22));
}

.p-collage-item:active {
  cursor: grabbing;
}

.p-collage-item.selected {
  outline: 3px dashed var(--c-vermilion);
  outline-offset: 6px;
}

/* 1. Frontal Almond Eye */
.p-item-front-eye {
  width: 110px;
  height: 60px;
  background: #FFFFFF;
  border: 4.5px solid #141416;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.p-item-front-eye .iris {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid #141416;
  display: flex;
  align-items: center;
  justify-content: center;
}

.p-item-front-eye .pupil {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #141416;
}

/* 2. Weeping Eye with Tears */
.p-item-weeping-eye {
  width: 80px;
  height: 120px;
}

.p-item-weeping-eye .weep-triangle {
  width: 70px;
  height: 44px;
  background: #FAF8F5;
  border: 4px solid #141416;
  clip-path: polygon(0 40%, 100% 0, 85% 100%, 0 85%);
}

.p-item-weeping-eye .tear-drop {
  width: 20px;
  height: 52px;
  border: 2.5px solid #141416;
  border-radius: 50% 50% 50% 50% / 0% 0% 100% 100%;
  margin: 6px auto 0;
  box-shadow: 2px 4px 8px rgba(0,0,0,0.25);
}

/* 3. Dual-Perspective Nose */
.p-item-dual-nose {
  width: 90px;
  height: 180px;
}

.p-item-dual-nose .nose-bridge {
  width: 46px;
  height: 100%;
  border-left: 5px solid #141416;
  border-bottom: 5px solid #141416;
  clip-path: polygon(100% 0, 0 85%, 100% 100%);
}

.p-item-dual-nose .nostril {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 24px;
  height: 16px;
  border: 3.5px solid #141416;
  border-radius: 50%;
  background: #141416;
}

/* 4. Weeping Distorted Mouth with Exposed Teeth */
.p-item-distorted-lips {
  width: 140px;
  height: 60px;
  background: #FAF8F5;
  border: 4px solid #141416;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.p-item-distorted-lips .upper-lip {
  height: 16px;
  background: var(--c-vermilion);
  border-bottom: 2px solid #141416;
}

.p-item-distorted-lips .teeth-row {
  flex: 1;
  background: #FFF;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  padding: 2px;
}

.p-item-distorted-lips .teeth-row span {
  background: #FFF;
  border: 1.5px solid #141416;
  border-radius: 2px;
}

.p-item-distorted-lips .lower-lip {
  height: 16px;
  background: var(--c-vermilion);
  border-top: 2px solid #141416;
}

/* 5. Dora Maar's Surrealist Hat */
.p-item-dora-hat {
  width: 160px;
  height: 90px;
}

.p-item-dora-hat .hat-crown {
  width: 100px;
  height: 55px;
  background: var(--c-citron);
  border: 4px solid #141416;
  border-radius: 30px 30px 0 0;
  margin: 0 auto;
}

.p-item-dora-hat .hat-brim {
  width: 160px;
  height: 18px;
  background: var(--c-emerald);
  border: 4px solid #141416;
  border-radius: 10px;
}

.p-item-dora-hat .hat-feather {
  position: absolute;
  top: -24px;
  right: 25px;
  width: 14px;
  height: 50px;
  background: var(--c-vermilion);
  border: 3px solid #141416;
  border-radius: 50% 50% 0 0;
  transform: rotate(25deg);
}

/* 6. Torn Newspaper (Le Journal 1912) Papier Collé */
.p-item-torn-newspaper {
  width: 150px;
  height: 200px;
  background: #EAE3D2;
  border: 2px solid #141416;
  padding: 12px;
  font-family: var(--font-editorial);
  box-shadow: 6px 10px 20px rgba(0,0,0,0.25);
  clip-path: polygon(0 0, 95% 2%, 100% 95%, 85% 100%, 0 92%);
}

.p-item-torn-newspaper .masthead {
  font-size: 1.35rem;
  font-weight: 900;
  text-align: center;
  border-bottom: 2px solid #141416;
  padding-bottom: 2px;
  letter-spacing: -0.03em;
}

.p-item-torn-newspaper .news-body {
  margin-top: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 0.44rem;
  line-height: 1.25;
  color: #222;
}

/* 7. Sheet Music Papier Collé */
.p-item-sheet-music {
  width: 140px;
  height: 180px;
  background: #F7F3E8;
  border: 2px solid #141416;
  padding: 10px;
  box-shadow: 6px 10px 20px rgba(0,0,0,0.22);
  clip-path: polygon(3% 0%, 100% 5%, 95% 98%, 0% 92%);
}

.p-item-sheet-music .stave {
  height: 16px;
  margin-bottom: 8px;
  background-image: repeating-linear-gradient(#141416, #141416 1.5px, transparent 1.5px, transparent 4px);
  position: relative;
}

.p-item-sheet-music .note-head {
  position: absolute;
  width: 7px;
  height: 6px;
  background: #141416;
  border-radius: 50%;
  top: 4px;
  left: 20px;
}

/* 8. Faux-Bois Woodgrain Wallpaper */
.p-item-faux-bois {
  width: 160px;
  height: 220px;
  border: 4px solid #141416;
  background: repeating-linear-gradient(45deg, #C08A4E, #C08A4E 6px, #8A5A2B 8px, #C08A4E 12px);
  box-shadow: 6px 12px 24px rgba(0,0,0,0.3);
  clip-path: polygon(0% 5%, 100% 0%, 95% 95%, 5% 100%);
}

/* 9. Picasso Breton Sailor Stripes (Marinière) */
.p-item-mariniere {
  width: 150px;
  height: 180px;
  border: 4px solid #141416;
  background: repeating-linear-gradient(0deg, #1848A0, #1848A0 12px, #FFF 12px, #FFF 24px);
  box-shadow: 6px 10px 22px rgba(0,0,0,0.25);
  clip-path: polygon(10% 0%, 100% 8%, 90% 100%, 0% 90%);
}

/* 10. Spanish Guitar Contour */
.p-item-spanish-guitar {
  width: 170px;
  height: 240px;
  border: 4.5px solid #141416;
  border-radius: 50px 50px 80px 80px / 40px 40px 100px 100px;
  box-shadow: 8px 14px 28px rgba(0,0,0,0.32);
  display: flex;
  align-items: center;
  justify-content: center;
}

.p-item-spanish-guitar .soundhole {
  width: 60px;
  height: 60px;
  background: #141416;
  border-radius: 50%;
  border: 4px solid #FFF;
}

/* 11. Playing Card (Ace) */
.p-item-playing-card {
  width: 75px;
  height: 110px;
  background: #FFF;
  border: 3px solid #141416;
  border-radius: 6px;
  box-shadow: 4px 8px 16px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px;
  font-family: var(--font-editorial);
  font-weight: 900;
  color: #D92525;
}

.p-item-playing-card .card-center {
  font-size: 28px;
  text-align: center;
}

/* 12. Pipe & Wine Goblet */
.p-item-pipe-goblet {
  width: 120px;
  height: 130px;
  border: 4px solid #141416;
  background: #FAF8F5;
  clip-path: polygon(0 0, 100% 20%, 80% 100%, 20% 80%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.p-item-pipe-goblet .goblet-stem {
  width: 8px;
  height: 60px;
  background: #141416;
}

/* Floating Maxim Widget */
.picasso-maxim-widget {
  top: 24px;
  right: 24px;
  width: 270px;
  position: absolute;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border: 2.5px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 6px 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 18;
  cursor: grab;
}

body.period-blue-period .picasso-maxim-widget,
body.period-guernica-stark .picasso-maxim-widget {
  background: rgba(17, 24, 39, 0.94);
  color: #FFF;
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-bottom: 2px solid var(--border-color);
  background: #F4EFE4;
}

body.period-blue-period .widget-header,
body.period-guernica-stark .widget-header {
  background: #1F2937;
}

.widget-stamp {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 800;
  background: var(--c-vermilion);
  color: #FFF;
  padding: 1px 4px;
  border-radius: 2px;
}

.widget-title {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 700;
}

.widget-close {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.widget-body {
  padding: 10px;
}

.quote-text {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-style: italic;
  line-height: 1.35;
}

.quote-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
}

.opus-code {
  color: var(--c-vermilion);
}

/* Canvas HUD Bottom Info Bar */
.canvas-hud {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-top: 14px;
  background: #FFFFFF;
  border: 2px solid var(--border-color);
  padding: 6px 16px;
  border-radius: 30px;
  box-shadow: 2px 2px 0px var(--border-color);
}

body.period-blue-period .canvas-hud,
body.period-guernica-stark .canvas-hud {
  background: #111827;
  color: #FFF;
}

.hud-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #777;
}

.hud-value {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
}

.text-accent {
  color: var(--c-vermilion);
}

.text-gold {
  color: #B45309;
}

.hud-item.hint {
  color: #555;
  font-size: 0.75rem;
  border-left: 1px solid #CCC;
  padding-left: 16px;
  font-weight: 500;
}

body.period-blue-period .hud-item.hint,
body.period-guernica-stark .hud-item.hint {
  color: #94A3B8;
  border-color: #374151;
}

/* ==========================================================================
   RIGHT CURATION & FLAMENCO PANEL
   ========================================================================== */

.curator-panel {
  background: #FFFFFF;
  border-left: 2.5px solid var(--border-color);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  z-index: 20;
}

body.period-blue-period .curator-panel,
body.period-guernica-stark .curator-panel {
  background: #111827;
}

.curator-header h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
}

.curator-header p {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.curator-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-desc {
  font-size: 0.72rem;
  color: #666;
  line-height: 1.35;
}

body.period-blue-period .section-desc,
body.period-guernica-stark .section-desc {
  color: #94A3B8;
}

/* Guitar string soundboard */
.guitar-strings-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.guitar-string-btn {
  padding: 10px 6px;
  background: #F8F5EC;
  border: 1.5px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  transition: all 0.15s ease;
  box-shadow: 1.5px 1.5px 0px var(--border-color);
}

body.period-blue-period .guitar-string-btn,
body.period-guernica-stark .guitar-string-btn {
  background: #1F2937;
  color: #FFF;
}

.guitar-string-btn:hover {
  background: #FFF;
  transform: translate(-1px, -1px);
  box-shadow: 2.5px 2.5px 0px var(--c-terracotta);
}

.str-line {
  width: 100%;
  background: #111;
  border-radius: 1px;
}

.str-6 { height: 4px; }
.str-5 { height: 3.5px; }
.str-4 { height: 3px; }
.str-3 { height: 2.5px; }
.str-2 { height: 2px; }
.str-1 { height: 1.5px; }

.w-full {
  width: 100%;
}

.wallpaper-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.quick-wall-btn {
  padding: 9px 8px;
  background: #F8F5EC;
  border: 1.5px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  transition: all 0.15s ease;
  box-shadow: 1.5px 1.5px 0px var(--border-color);
}

body.period-blue-period .quick-wall-btn,
body.period-guernica-stark .quick-wall-btn {
  background: #1F2937;
  color: #FFF;
}

.quick-wall-btn:hover {
  background: #FFF;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px var(--c-vermilion);
  border-color: var(--c-vermilion);
}

.quick-wall-btn i {
  font-size: 1.1rem;
}

/* ==========================================================================
   MODALS: INTERIOR ATELIER PREVIEW & EXPORT STUDIO
   ========================================================================== */

.interior-modal-overlay,
.export-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.interior-modal-overlay.open,
.export-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.interior-modal-container,
.export-modal-container {
  background: #FFF;
  border: 3px solid var(--border-color);
  box-shadow: 10px 14px 0px rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  width: min(94vw, 1100px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.interior-modal-header,
.export-header {
  padding: 16px 24px;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FAF8F5;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title-wrap i {
  font-size: 1.4rem;
  color: var(--c-vermilion);
}

.modal-title-wrap h2,
.export-header h2 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
}

.export-header p {
  font-size: 0.8rem;
  color: #666;
  margin-top: 2px;
}

.interior-view-tabs {
  display: flex;
  background: #EAE7E0;
  border: 1.5px solid var(--border-color);
  padding: 3px;
  border-radius: 6px;
  gap: 3px;
}

.interior-tab {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.interior-tab.active {
  background: #FFF;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 6px;
}

/* Virtual Atelier Stage */
.interior-stage {
  height: 520px;
  background: #252422;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scene-environment {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s ease;
}

.scene-parisian-atelier {
  background: linear-gradient(180deg, #D4C7B3 0%, #B8AA94 65%, #3E3228 65%, #251E17 100%);
}

.scene-modern-loft {
  background: linear-gradient(180deg, #EFECE6 0%, #D8D3C8 68%, #3A352F 68%, #201E1B 100%);
}

.scene-phone-mockup {
  background: radial-gradient(circle at center, #1E293B 0%, #000000 100%);
}

.scene-macbook-mockup {
  background: linear-gradient(135deg, #1C1917 0%, #0C0A09 100%);
}

.artwork-frame {
  width: 440px;
  height: 330px;
  background: #111111;
  padding: 18px;
  border-radius: 2px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 5;
  transition: all 0.4s ease;
}

.scene-phone-mockup .artwork-frame {
  width: 220px;
  height: 440px;
  border-radius: 36px;
  padding: 10px;
  border: 4px solid #444;
}

.scene-phone-mockup .frame-plaque {
  display: none;
}

.frame-passepartout {
  flex: 1;
  background: #FAF8F5;
  padding: 16px;
  display: flex;
  overflow: hidden;
}

.artwork-clone-viewport {
  width: 100%;
  height: 100%;
  position: relative;
  background: #E8DEC8;
  border: 4px solid #111;
  overflow: hidden;
}

.frame-plaque {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: #DDD;
  text-align: center;
  letter-spacing: 0.05em;
}

.sofa-silhouette {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 580px;
  height: 80px;
  background: #1C1B19;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.4);
  z-index: 10;
}

.scene-phone-mockup .sofa-silhouette,
.scene-macbook-mockup .sofa-silhouette {
  display: none;
}

.plant-silhouette {
  position: absolute;
  bottom: 30px;
  left: 60px;
  width: 70px;
  height: 160px;
  background: radial-gradient(ellipse at bottom, #111 60%, transparent 70%);
  opacity: 0.8;
}

.scene-phone-mockup .plant-silhouette,
.scene-macbook-mockup .plant-silhouette {
  display: none;
}

.gallery-spotlight {
  position: absolute;
  top: 0;
  width: 500px;
  height: 350px;
  background: radial-gradient(ellipse at top, rgba(255, 255, 240, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.interior-footer {
  padding: 12px 24px;
  background: #FAF8F5;
  border-top: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.interior-footer p {
  font-size: 0.78rem;
  color: #555;
}

/* ==========================================================================
   EXPORT & PRINT MODAL
   ========================================================================== */

.export-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 24px;
  gap: 24px;
  overflow-y: auto;
}

.export-preview-column {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F0EDE6;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  padding: 20px;
}

.print-preview-frame {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 3 / 4;
  background: #111111;
  padding: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  display: flex;
}

.print-mat-board {
  flex: 1;
  background: #FFF;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.print-artwork-embed {
  flex: 1;
  position: relative;
  background: #E8DEC8;
  border: 4px solid #111;
  overflow: hidden;
}

.print-curator-plaque {
  margin-top: 16px;
  border-top: 1.5px solid #111;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.plaque-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.plaque-sub {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: #666;
}

.plaque-signature {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-style: italic;
}

.edition-sig {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-style: normal;
  color: #888;
}

.export-options-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.option-card {
  background: #FAF8F5;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-card h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.option-card p {
  font-size: 0.76rem;
  color: #666;
  line-height: 1.35;
}

.radio-resolutions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.res-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #FFF;
  border: 1.5px solid var(--border-color);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.res-choice.active {
  border-color: var(--c-vermilion);
  background: #FFF5F0;
}

.res-info {
  display: flex;
  flex-direction: column;
}

.res-info strong {
  font-size: 0.75rem;
  font-family: var(--font-display);
}

.res-info span {
  font-size: 0.65rem;
  color: #777;
  font-family: var(--font-mono);
}

.export-buttons-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ==========================================================================
   DIRECT ARCHIVAL PRINT STYLES (@media print)
   ========================================================================== */

.printable-gallery-page {
  display: none;
}

@media print {
  body {
    background: #FFF !important;
    overflow: visible !important;
  }

  .studio-header,
  .palette-dock,
  .curator-panel,
  .canvas-hud,
  .interior-modal-overlay,
  .export-modal-overlay,
  .floating-widget {
    display: none !important;
  }

  .printable-gallery-page {
    display: block !important;
    width: 100vw;
    height: 100vh;
    padding: 2cm;
    page-break-after: always;
    box-sizing: border-box;
  }

  .print-border-frame {
    width: 100%;
    height: 100%;
    border: 12px solid #000;
    padding: 3cm;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
  }

  .print-inner-canvas {
    flex: 1;
    position: relative;
    border: 6px solid #000;
    overflow: hidden;
  }

  .print-museum-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5cm;
    border-top: 2px solid #000;
    padding-top: 0.5cm;
    font-family: 'Space Grotesk', sans-serif;
  }

  .print-museum-footer h3 {
    font-size: 14pt;
    font-weight: 800;
  }

  .print-museum-footer p {
    font-size: 9pt;
    font-family: 'Space Mono', monospace;
  }
}

@media (max-width: 1100px) {
  .studio-workspace {
    grid-template-columns: 200px 1fr;
  }
  .curator-panel {
    display: none;
  }
}

/* Radar Scan Line for Play Painting Mode */
.picasso-scan-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #E63946, #D4A373, #F4A261);
  box-shadow: 0 0 18px rgba(230, 57, 70, 0.9), 0 0 8px #FFF;
  z-index: 25;
  display: none;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.picasso-scan-line.active {
  display: block;
}

.layer-playing-hit {
  filter: brightness(1.6) saturate(1.3) !important;
  outline: 3px solid rgba(230, 57, 70, 0.9) !important;
  box-shadow: 0 0 25px rgba(230, 57, 70, 0.8) !important;
  transition: filter 0.08s ease, box-shadow 0.08s ease;
}

/* ==========================================================================
   CUSTOM FRAME & PRINT SIZING STUDIO STYLES
   ========================================================================== */

.print-controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.control-group-compact {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.control-group-compact label {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #444;
  display: flex;
  align-items: center;
  gap: 5px;
}

.select-compact, .input-compact {
  width: 100%;
  padding: 6px 8px;
  font-size: 0.78rem;
  border: 1.5px solid var(--border-color);
  border-radius: 4px;
  background: #FFF;
  color: #111;
  font-family: var(--font-sans);
  outline: none;
}

.custom-dimensions-box {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  background: #F0EDE6;
  padding: 8px;
  border-radius: 5px;
  border: 1px dashed #BBB;
}

.orientation-pill-group {
  display: flex;
  gap: 4px;
}

.orient-pill {
  flex: 1;
  padding: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #FFF;
  border: 1.5px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.orient-pill.active {
  background: #111;
  color: #FFF;
  border-color: #111;
}

/* Dynamic Frame Border Classes */
.frame-black {
  background: #111111 !important;
  border: 14px solid #111111 !important;
  box-shadow: 0 15px 40px rgba(0,0,0,0.45) !important;
}

.frame-walnut {
  background: #3E2723 !important;
  border: 14px solid #4E342E !important;
  box-shadow: 0 15px 40px rgba(62,39,35,0.45) !important;
}

.frame-white {
  background: #FDFBF7 !important;
  border: 14px solid #E5E7EB !important;
  box-shadow: 0 15px 40px rgba(0,0,0,0.2) !important;
}

.frame-gold {
  background: #B45309 !important;
  border: 14px solid #D4AF37 !important;
  box-shadow: 0 15px 40px rgba(212,175,55,0.35) !important;
}

.frame-frameless {
  background: transparent !important;
  border: 0px none !important;
  padding: 0 !important;
  box-shadow: 0 15px 35px rgba(0,0,0,0.25) !important;
}

/* Dynamic Mat Board Classes */
.mat-none { padding: 0px !important; }
.mat-slim { padding: 12px !important; }
.mat-classic { padding: 22px !important; }
.mat-wide { padding: 34px !important; }


/* Mobile studio shell */
@media (max-width: 900px) {
  html, body { height: 100dvh; }
  .studio-header {
    height: auto;
    min-height: 52px;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
  }
  .brand-subtitle, .edition-badge, .brand-titles p { display: none; }
  .studio-header button { min-width: 40px; min-height: 40px; }
  .export-body, .export-modal-body, .modal-body, .print-controls-grid { grid-template-columns: 1fr; }
  .export-modal-container, .export-modal-dialog, .modal-dialog, .modal-card, .interior-modal-container {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    max-height: 88dvh;
  }
  .sofa-silhouette { width: min(580px, 100%); }
  .picasso-stage, .kandinsky-stage, .monet-art-stage, .dali-art-stage,
  .stage-surface, .emin-stage-surface, .mondrian-grid,
  .stage-collage-surface, .stage-flora-surface, .stage-dali-surface,
  .p-collage-item, .m-flora-item, .dali-entity, .klimt-entity, .kusama-entity,
  .kahlo-entity, .haring-entity, .emin-entity, .k-entity {
    touch-action: none;
  }
}
