/* McCarthy Creations look for the Shapeyard kids' Design Lab: the website's navy, coral and yellow,
   its "tape and paper" style (polaroids, tape strips, handwriting) and its seasonal themes.
   Only looks live here; the app itself is the same code as the main Shapeyard. */

/* the website's handwriting font (bundled in the app image, no outside requests) */
@font-face { font-family: Caveat; font-weight: 700; font-display: swap; src: url(../vendor/textfonts/caveat.woff) format('woff'); }

:root, body {
  --bg: #0F1A33;          /* site navy */
  --panel: #14234A;
  --panel2: #1B2E5C;
  --panel3: #24396D;
  --border: #2B3D69;      /* site navy-line */
  --text: #FFF4E4;        /* site cream */
  --muted: #C5CFE4;
  --accent: #F47070;      /* site coral */
  --accent-strong: #E85C5C;
  --accent-shadow: #091226;
  --accent-soft: rgba(244, 112, 112, .2);
  --cream: #FFF4E4;
  --cream-shadow: #D9CBB4;
  --gold: #FFD43B;        /* site yellow */
  --warn: #FFD43B;
  --ok: #6BE04F;          /* site green */
  --rainbow: linear-gradient(90deg, #F47070, #FFD43B, #F47070);
  /* paper, tape and ink */
  --paper: #FFF4E4;
  --paper-2: #F4E6CC;
  --paper-3: #EAD7B6;
  --paper-line: #D8C29C;
  --ink: #0F1A33;
  --ink-soft: #4E5A78;
  --tape: #FFD43B;
  --tab: #C08A4E;
  --hand: Caveat, 'Comic Sans MS', cursive;
  /* 3D view colours (read by the app) */
  --scene-bg: #13224A;
  --bed: #2B4C86;
}

/* ---------- the website's chunky buttons: coral with a hard navy shadow that presses in ---------- */
.tb.primary, .btn.accent, .auth-submit {
  background: var(--accent); color: var(--ink); border-radius: 12px;
  box-shadow: 4px 4px 0 var(--accent-shadow); transition: transform .12s, box-shadow .12s;
}
.tb.primary:hover, .btn.accent:hover, .auth-submit:hover { background: var(--accent); transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--accent-shadow); }
.tb.primary svg.i, .btn.accent svg.i { stroke: var(--ink); }

/* ---------- top bar: brand in handwriting, yellow underline ---------- */
#topbar::after { background: var(--tape); height: 3px; opacity: .9; }
.brand .mark { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; transform: rotate(-6deg); background: none; box-shadow: none; transition: transform .3s; }
.brand:hover .mark { transform: rotate(6deg); }
.brand-name { font-family: var(--hand); font-weight: 700; font-size: 27px; color: var(--gold); transform: rotate(-2deg); display: inline-block; line-height: 1; }
.season-hello { font-family: var(--hand); font-weight: 700; font-size: 21px; color: var(--cream); transform: rotate(-3deg); white-space: nowrap; margin: 0 6px; opacity: .95; }
body.mobile .season-hello { display: none; }

/* ---------- the 3D view: a polaroid taped to the wall ---------- */
#viewport { border: 8px solid var(--paper); border-bottom-width: 14px; border-radius: 6px; margin: 10px 10px 4px; box-shadow: 6px 8px 0 rgba(0, 0, 0, .35); overflow: visible; }
#viewport > canvas { border-radius: 2px; }
#viewport::before, #viewport::after { content: ""; position: absolute; top: -13px; width: 90px; height: 22px; background: var(--tape); opacity: .85; z-index: 7; pointer-events: none; }
#viewport::before { left: 26px; transform: rotate(-6deg); }
#viewport::after { right: 34px; transform: rotate(5deg); }
body.mobile #viewport { border-width: 5px; border-bottom-width: 8px; margin: 6px; }
body.mobile #viewport::before, body.mobile #viewport::after { width: 64px; height: 18px; top: -12px; }

/* ---------- shapes: little polaroids with a tape tab and handwritten labels ---------- */
.palhead { font-family: var(--hand); font-weight: 700; font-size: 22px; text-transform: none; letter-spacing: 0; color: var(--gold); }
.palhead .count { font-family: Fredoka, sans-serif; }
.shape-search { background: var(--paper); color: var(--ink); border-color: var(--paper-line); }
.shape-search::placeholder { color: var(--ink-soft); }
.shapes { gap: 12px 9px; padding-top: 8px; }
.shape { position: relative; background: var(--paper); border: 0; border-radius: 3px; padding: 6px 6px 4px; box-shadow: 3px 4px 0 rgba(0, 0, 0, .35); transition: transform .15s; }
.shape::before { content: ""; position: absolute; top: -8px; left: 50%; margin-left: -7px; width: 14px; height: 18px; border-radius: 3px; background: var(--tab); opacity: .95; }
.shape img { background: #1B2E5C; border-radius: 2px; }
.shape span { font-family: var(--hand); font-weight: 700; font-size: 16px; line-height: 1; color: var(--ink); margin-top: 3px; }
.shape:nth-child(4n+1) { transform: rotate(-3deg); }
.shape:nth-child(4n+2) { transform: rotate(2deg); }
.shape:nth-child(4n+3) { transform: rotate(-1.5deg); }
.shape:nth-child(4n) { transform: rotate(3deg); }
.shape:hover { background: var(--paper); transform: rotate(0) scale(1.06); box-shadow: 4px 6px 0 rgba(0, 0, 0, .4); }
#palette h3 { font-family: var(--hand); font-weight: 700; font-size: 22px; color: var(--gold); text-transform: none; letter-spacing: 0; }

/* ---------- paper: the inspector, the object list and every pop-up ---------- */
#sidebar, .modal-card, .auth-card, #ctxMenu, .menu {
  --panel: var(--paper); --panel2: var(--paper-2); --panel3: var(--paper-3); --border: var(--paper-line);
  --bg: #FFFBF3; --text: var(--ink); --muted: var(--ink-soft); --cream: var(--ink); --cream-shadow: var(--paper-line);
  color: var(--ink);
}
#sidebar { background: var(--paper); position: relative; margin: 10px 10px 4px 2px; border-radius: 4px; box-shadow: 6px 8px 0 rgba(0, 0, 0, .35); }
#sidebar::before { content: ""; position: absolute; top: -10px; left: 50%; width: 100px; height: 22px; margin-left: -55px; background: var(--tape); opacity: .85; transform: rotate(-5deg); z-index: 2; pointer-events: none; }
#sidebar h4 { font-family: var(--hand); font-weight: 700; font-size: 20px; text-transform: none; letter-spacing: 0; color: var(--ink); }
#sidebar input, #sidebar select, .modal-card input, .modal-card select { color: var(--ink); }
#outlineWrap { border-top: 2px dashed var(--paper-line); }
.modal-card, .auth-card { background: var(--paper); border: 0; border-radius: 6px; box-shadow: 8px 10px 0 rgba(0, 0, 0, .4); position: relative; overflow: visible; }
.modal-card::after, .auth-card::after { content: ""; position: absolute; top: -14px; left: 50%; width: 120px; height: 28px; margin-left: -60px; background: var(--tape); opacity: .85; transform: rotate(-4deg); pointer-events: none; }
.modal-card h2, .auth-brand h1 { font-family: var(--hand); font-weight: 700; font-size: 30px; color: var(--ink); }
.auth-card::before { display: none; }
.auth { background: radial-gradient(1200px 600px at 20% 0%, #1B2E5C 0%, #0F1A33 60%); }
.auth-field input { background: #FFFBF3; color: var(--ink); border-color: var(--paper-line); }
.auth-privacy { background: rgba(107, 224, 79, .16); border-color: #7FC96B; color: var(--ink); }
.auth-tabs button.on { background: var(--ink); color: var(--paper); }
.ticket-card .ticket-help { color: var(--ink-soft); }
.panel-card.ticket-card { background: #14234A; --text: #FFF4E4; --muted: #C5CFE4; color: #FFF4E4; } /* the ticket keeps its own look */
.panel-card.ticket-card h2 { color: var(--gold); }

/* ---------- bottom bar: the website's yellow ticker ---------- */
#status { background: #091226; color: var(--gold); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
#status .muted, #status label { color: #C5CFE4; }

/* =================================================================================================
   Seasonal themes: the website's choice on its admin Dashboard (winter, Thanksgiving, New Year).
   Same colours as the site, plus the same drift of flakes, leaves or confetti, over the build plate.
   ================================================================================================= */
body.season-winter {
  --bg: #0B2545; --panel: #0E2D52; --panel2: #143A66; --panel3: #1B477A; --border: #2C4F7C; --muted: #C9DAF0;
  --accent: #9FE3FF; --accent-strong: #8AD6F5; --accent-shadow: #071A33; --gold: #9FE3FF; --tape: #CFEFFF; --tab: #8FB6D9;
  --scene-bg: #11345E; --bed: #2C5C8F;
}
body.season-thanksgiving {
  --bg: #2A1810; --panel: #33200F; --panel2: #43291A; --panel3: #553423; --border: #5E3D29; --muted: #E6D2BC;
  --accent: #F08A3C; --accent-strong: #E07A2C; --accent-shadow: #1C0F09; --gold: #F2B544; --tape: #F2B544; --tab: #A86A3A;
  --scene-bg: #3A2316; --bed: #6B4426;
}
body.season-newyear {
  --bg: #0C0B18; --panel: #13122A; --panel2: #1C1A3A; --panel3: #26234D; --border: #37355A; --muted: #D2D0E6;
  --accent: #F5D06F; --accent-strong: #E8C25C; --accent-shadow: #06060D; --gold: #F5D06F; --tape: #F5D06F; --tab: #8F7BD6;
  --scene-bg: #15132A; --bed: #2B2850;
}
/* the drift over the 3D view (never blocks clicks) */
body[class*="season-"] #seasonDrift {
  animation: lab-drift 28s linear infinite; opacity: .5;
}
@keyframes lab-drift { from { background-position: 0 0; } to { background-position: 0 360px; } }
body.season-winter #seasonDrift {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='360' fill='none' stroke='%23fff' stroke-width='1.600' stroke-linecap='round'%3E%3Cg transform='translate(50 60)'%3E%3Cpath d='M0-9v18M-7.800-4.500l15.600 9M7.800-4.500l-15.600 9'/%3E%3C/g%3E%3Cg transform='translate(250 40) scale(.6)'%3E%3Cpath d='M0-9v18M-7.800-4.500l15.600 9M7.800-4.500l-15.600 9'/%3E%3C/g%3E%3Cg transform='translate(170 170) scale(1.300)'%3E%3Cpath d='M0-9v18M-7.800-4.500l15.600 9M7.800-4.500l-15.600 9'/%3E%3C/g%3E%3Cg transform='translate(320 230) scale(.8)'%3E%3Cpath d='M0-9v18M-7.800-4.500l15.600 9M7.800-4.500l-15.600 9'/%3E%3C/g%3E%3Cg transform='translate(90 290) scale(.7)'%3E%3Cpath d='M0-9v18M-7.800-4.500l15.600 9M7.800-4.500l-15.600 9'/%3E%3C/g%3E%3Ccircle cx='130' cy='100' r='2' fill='%23fff' stroke='none'/%3E%3Ccircle cx='290' cy='140' r='1.500' fill='%23fff' stroke='none'/%3E%3Ccircle cx='30' cy='200' r='2' fill='%23fff' stroke='none'/%3E%3Ccircle cx='220' cy='310' r='1.500' fill='%23fff' stroke='none'/%3E%3C/svg%3E");
  opacity: .45;
}
body.season-thanksgiving #seasonDrift {
  animation-duration: 40s; opacity: .45;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='360'%3E%3Cdefs%3E%3Cpath id='l' d='M0-10c2 3 5 3.500 7 3-.500 3 1 5 3 6-2 1.500-3 3.500-3 6-2.500-.500-5 .500-6.200 2.500V10h-1.600V7.500C-2 5.500-4.500 4.500-7 5c0-2.500-1-4.500-3-6 2-1 3.500-3 3-6 2 .500 5 0 7-3z'/%3E%3C/defs%3E%3Cuse href='%23l' transform='translate(60 50) rotate(20)' fill='%23F08A3C'/%3E%3Cuse href='%23l' transform='translate(260 90) rotate(-35) scale(.8)' fill='%23F2B544'/%3E%3Cuse href='%23l' transform='translate(160 190) rotate(70) scale(1.200)' fill='%23C4502A'/%3E%3Cuse href='%23l' transform='translate(320 260) rotate(10) scale(.7)' fill='%23F08A3C'/%3E%3Cuse href='%23l' transform='translate(70 300) rotate(-60) scale(.9)' fill='%23F2B544'/%3E%3C/svg%3E");
}
body.season-newyear #seasonDrift {
  animation-duration: 22s; opacity: .6;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='360'%3E%3Crect x='40' y='50' width='9' height='4' fill='%23F5D06F' transform='rotate(30 44 52)'/%3E%3Crect x='250' y='30' width='9' height='4' fill='%23C9C9E8' transform='rotate(-40 254 32)'/%3E%3Crect x='150' y='140' width='9' height='4' fill='%23F47070' transform='rotate(65 154 142)'/%3E%3Crect x='310' y='210' width='9' height='4' fill='%23F5D06F' transform='rotate(-15 314 212)'/%3E%3Crect x='80' y='270' width='9' height='4' fill='%2338C6F4' transform='rotate(50 84 272)'/%3E%3Crect x='210' y='310' width='9' height='4' fill='%23C9C9E8' transform='rotate(-70 214 312)'/%3E%3Ccircle cx='120' cy='80' r='2.500' fill='%23F5D06F'/%3E%3Ccircle cx='290' cy='130' r='2' fill='%23fff'/%3E%3Ccircle cx='30' cy='180' r='2' fill='%23C9C9E8'/%3E%3Ccircle cx='190' cy='240' r='2.500' fill='%23F5D06F'/%3E%3Cpath d='M330 60l1.500 4.500 4.500 1.500-4.500 1.500-1.500 4.500-1.500-4.500-4.500-1.500 4.500-1.500z' fill='%23fff'/%3E%3Cpath d='M100 190l1.500 4.500 4.500 1.500-4.500 1.500-1.500 4.500-1.500-4.500-4.500-1.500 4.500-1.500z' fill='%23F5D06F'/%3E%3C/svg%3E");
}
@media (prefers-reduced-motion: reduce) { body[class*="season-"] #seasonDrift { animation: none; } }
