/* Creator Studio (create.html). Uses the home page's hero, sections, cards and buttons; only the studio pieces live here. */
.cs-art .blob { inset: 10px 20px; }
.cs-mosaic { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.cs-mosaic__grid { display: grid; grid-template-columns: repeat(3, 92px); gap: 14px; transform: rotate(-8deg); }
.cs-tile {
  position: relative; height: 92px; border-radius: 20px; overflow: hidden;
  box-shadow: 0 10px 22px rgba(18,34,74,.3), inset 0 0 0 3px rgba(255,255,255,.35);
  animation: bob 5s ease-in-out infinite;
}
.cs-tile:nth-child(2n) { animation-delay: -1.6s; }
.cs-tile:nth-child(3n) { animation-delay: -3.2s; }
.cs-tile i { position: absolute; font-style: normal; line-height: 1; }
.cs-tile i:first-child { font-size: 44px; left: 14%; bottom: 12%; }
.cs-tile i:last-child { font-size: 24px; right: 10%; top: 10%; }
.cs-art .f2 { right: 0; top: -6px; width: 110px; height: 110px; z-index: 1; }
.cs-art .f5 { left: 0; bottom: 0; width: 76px; height: 76px; z-index: 1; }
@media (prefers-reduced-motion: reduce) { .cs-tile { animation: none; } }

/* Studio: same cards, borders and radius as the home catalog. */
.cs-studio {
  --cs-card: #fff; --cs-soft: var(--tint); --cs-field: #f7f9ff;
  scroll-margin-top: 72px; padding: 48px 0 64px;
}
[data-theme="dark"] .cs-studio { --cs-card: var(--surface); --cs-soft: #1d2a57; --cs-field: var(--bg); }
.studio__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.studio__name { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; background: var(--cs-card); border: 2px solid var(--line); border-radius: 16px; padding: 6px 14px; box-shadow: var(--shadow); }
.studio__name span[aria-hidden] { font-size: 1.4rem; }
.studio__name input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--ink); font: 900 1.25rem/1.2 var(--font); padding: 6px 0; box-shadow: none; }
.studio__name input:focus { outline: none; box-shadow: none; }
.studio__name:focus-within { border-color: var(--blue); }
.studio__mode { flex: none; font-weight: 800; font-size: .85rem; padding: 7px 12px; border-radius: 999px; background: #fff3d6; color: #8a5a00; cursor: help; }
[data-theme="dark"] .studio__mode { background: #3a3317; color: #ffe08a; }
.studio__mode.is-ai { background: rgba(76,182,138,.16); color: var(--green-dark); }
[data-theme="dark"] .studio__mode.is-ai { color: #7fdcb2; }
.studio__tools { display: flex; flex-wrap: wrap; gap: 8px; }
.tool { background: var(--cs-card); color: var(--ink); border: 2px solid var(--line); border-radius: 999px; padding: 8px 14px; font: 800 .95rem var(--font); cursor: pointer; }
.tool:hover:not(:disabled) { border-color: var(--blue); color: var(--blue-text); }
.tool:disabled { opacity: .45; cursor: default; }

.cs-studio .wrap--wide { width: min(1560px, calc(100% - 32px)); max-width: none; }
/* Like a block game editor: console on the left, blocks in the middle, Byte on the right. */
.studio {
  display: grid; gap: 16px; align-items: stretch;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr) minmax(280px, 330px);
  grid-template-areas: "sim editor helper";
}
.sim { grid-area: sim; min-width: 0; }
.editor { grid-area: editor; min-width: 0; }
.helper { grid-area: helper; }
.helper { display: flex; flex-direction: column; background: var(--cs-card); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px; height: 660px; min-height: 0; box-shadow: var(--shadow); }
.helper__head { display: flex; align-items: center; gap: 10px; padding: 2px 4px 12px; border-bottom: 2px solid var(--line); }
.helper__head img { width: 52px; height: 52px; }
.helper__head div { flex: 1; display: grid; }
.helper__head b { font-size: 1.15rem; font-weight: 900; color: var(--ink); }
.helper__head span { color: var(--ink-2); font-size: .9rem; font-weight: 700; }
.tts { width: 42px; height: 42px; border-radius: 12px; border: 2px solid var(--line); background: transparent; font-size: 1.2rem; cursor: pointer; }
.tts[aria-pressed="true"] { border-color: var(--green); background: rgba(76,182,138,.15); }
.helper__log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 14px 4px; min-height: 120px; }
.bubble { max-width: 88%; padding: 11px 14px; border-radius: 18px; line-height: 1.4; font-weight: 600; white-space: pre-wrap; word-wrap: break-word; }
.bubble--bot { align-self: flex-start; background: var(--cs-soft); color: var(--ink); border-bottom-left-radius: 6px; }
.bubble--kid { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 6px; }
.bubble--typing { display: flex; gap: 5px; padding: 14px 16px; }
.bubble--typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); animation: cs-dot 1s infinite; }
.bubble--typing i:nth-child(2) { animation-delay: .15s; }
.bubble--typing i:nth-child(3) { animation-delay: .3s; }
@keyframes cs-dot { 50% { transform: translateY(-5px); opacity: .5; } }
.helper__ideas { padding: 10px 2px 8px; border-top: 2px solid var(--line); }
.helper__ideas .kicker, .panel-box .kicker { font-size: .75rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-studio .chip { padding: 7px 12px; font-size: .9rem; }
.cs-studio .chip:hover { border-color: var(--blue); }
.helper__ideas .chips { max-height: 92px; overflow-y: auto; }
.helper__form { display: flex; gap: 8px; align-items: stretch; padding-top: 10px; }
.helper__form textarea {
  flex: 1; min-width: 0; resize: none; background: var(--cs-field); color: var(--ink); border: 2px solid var(--line); border-radius: 14px;
  padding: 10px 12px; font: 600 1rem/1.35 var(--font);
}
.helper__form textarea:focus { outline: none; border-color: var(--blue); }
.mic {
  flex: none; width: 58px; border-radius: 16px; border: 0; cursor: pointer; color: #fff;
  background: linear-gradient(160deg, #c4167c, #8a1fd1); box-shadow: 0 4px 0 #5e1491;
}
.mic.is-on { animation: cs-pulse 1.1s infinite; background: linear-gradient(160deg, #e5484d, #c4167c); }
.mic.is-off { opacity: .45; }
@keyframes cs-pulse { 0% { box-shadow: 0 0 0 0 rgba(229,72,77,.6); } 100% { box-shadow: 0 0 0 16px rgba(229,72,77,0); } }
.send { flex: none; border: 0; border-radius: 14px; padding: 0 16px; font: 900 1rem var(--font); color: #fff; background: var(--green); box-shadow: 0 4px 0 var(--green-dark); cursor: pointer; }
.helper__form.is-busy .send { opacity: .6; cursor: wait; }
.helper__hint { min-height: 1.3em; margin: 8px 2px 0; color: #b26b00; font-weight: 700; font-size: .9rem; }
[data-theme="dark"] .helper__hint { color: #ffe08a; }

/* Game console (original design, in the brand colors) */
.console {
  position: relative; padding: 16px 16px 22px; border-radius: 28px 28px 44px 44px;
  background: linear-gradient(170deg, #3d7df0, #1f2aa8); box-shadow: 0 8px 0 #18208a, var(--shadow);
}
.stage__screen { position: relative; border-radius: 14px; overflow: hidden; border: 6px solid #10184a; background: #1f2aa8; }
.console__pad { display: flex; align-items: center; justify-content: space-between; padding: 18px 6px 0; }
.dpad { position: relative; width: 120px; height: 120px; }
.dpad__b {
  position: absolute; width: 40px; height: 40px; border: 0; background: #10184a; cursor: pointer; touch-action: none;
}
.dpad__b::after { content: ""; position: absolute; inset: 0; margin: auto; width: 0; height: 0; border: 8px solid transparent; }
.dpad__up { left: 40px; top: 0; border-radius: 10px 10px 0 0; }
.dpad__down { left: 40px; bottom: 0; border-radius: 0 0 10px 10px; }
.dpad__left { left: 0; top: 40px; border-radius: 10px 0 0 10px; }
.dpad__right { right: 0; top: 40px; border-radius: 0 10px 10px 0; }
.dpad::after { content: ""; position: absolute; left: 40px; top: 40px; width: 40px; height: 40px; background: #10184a; }
.dpad__up::after { border-bottom-color: #8fb3ff; margin-top: 4px; }
.dpad__down::after { border-top-color: #8fb3ff; margin-bottom: 4px; }
.dpad__left::after { border-right-color: #8fb3ff; margin-left: 4px; }
.dpad__right::after { border-left-color: #8fb3ff; margin-right: 4px; }
.ab { display: flex; gap: 14px; align-items: flex-start; transform: rotate(-18deg); }
.ab__b {
  width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer; touch-action: none;
  font: 900 1.3rem var(--font); color: #fff; background: var(--magenta); box-shadow: 0 5px 0 #8a0f57;
}
.ab__b--b { margin-top: 26px; background: var(--orange); box-shadow: 0 5px 0 #c98400; }
.dpad__b.is-down, .dpad__b:active { background: #0a0f33; }
.ab__b.is-down, .ab__b:active { transform: translateY(4px); box-shadow: 0 1px 0 #8a0f57; }
.ab__b--b.is-down, .ab__b--b:active { box-shadow: 0 1px 0 #c98400; }

/* Blocks */
.editor { display: flex; flex-direction: column; background: var(--cs-card); border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); min-height: 660px; }
.editor__head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 2px solid var(--line); }
.editor__tab { flex: none; font-weight: 900; padding: 6px 14px; border-radius: 999px; background: var(--blue); color: #fff; }
.editor__hint { margin: 0; color: var(--ink-2); font-weight: 700; font-size: .92rem; }
.editor__ws { position: relative; flex: 1; min-height: 420px; }
.editor .blocklyToolboxCategoryLabel, .editor .blocklyTreeLabel { font-family: var(--font); font-weight: 800; }
.editor .blocklyToolbox, .editor .blocklyToolboxDiv { border-right: 2px solid var(--line); }
.stage__screen canvas { display: block; width: 100%; aspect-ratio: 8 / 5; touch-action: none; cursor: pointer; }
.stage__screen:fullscreen { display: grid; place-items: center; border: 0; border-radius: 0; background: #000; }
.stage__screen:fullscreen canvas { width: min(100vw, 160vh); }
.stage__controls { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 0; }

/* Grown-ups */
.cs-parents { display: grid; grid-template-columns: .8fr 1.2fr; gap: 32px; align-items: start; }
.cs-parents h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 900; }

/* Dialogs */
.cs-dialog .wl__body { padding: 32px 28px 28px; display: grid; gap: 12px; }
.cs-dialog h2 { margin: 0; font-weight: 900; }
.cs-dialog p { margin: 0; }
.cs-dialog__icon { font-size: 3rem; text-align: center; }
.mine { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.mine li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 14px; }
.mine__e { font-size: 1.8rem; }
.mine__t { flex: 1; font-weight: 800; display: grid; min-width: 0; }
.mine__t small { color: var(--ink-2); font-weight: 700; }
.mine li.mine__none { color: var(--ink-2); border-style: dashed; }

@media (max-width: 1240px) {
  .studio { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); grid-template-areas: "sim editor" "helper editor"; }
  .helper { height: 520px; }
}
@media (max-width: 860px) {
  /* Phones: Byte (talk or type) right under the console, the blocks after it. */
  .studio { grid-template-columns: minmax(0, 1fr); grid-template-areas: "sim" "helper" "editor"; }
  .sim { max-width: 460px; width: 100%; margin: 0 auto; }
  .editor { min-height: 520px; }
  .helper { height: 560px; }
  .cs-parents { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .cs-mosaic__grid { grid-template-columns: repeat(3, 56px); gap: 9px; }
  .cs-tile { height: 56px; border-radius: 14px; }
  .cs-tile i:first-child { font-size: 28px; }
  .cs-tile i:last-child { font-size: 15px; }
  .cs-art .f2 { width: 70px; height: 70px; }
  .cs-art .f5 { width: 50px; height: 50px; }
  .studio__tools .tool span:not([aria-hidden]) { display: none; }
  .studio__tools .tool { padding: 9px 12px; font-size: 1.05rem; }
}
@media (max-width: 400px) {
  /* Small phones: arrows and A/B side by side without overlapping. */
  .console { padding: 12px 12px 18px; }
  .console__pad { padding: 14px 0 0; }
  .dpad { transform: scale(.88); transform-origin: left center; }
  .ab { gap: 8px; transform: rotate(-18deg) scale(.86); transform-origin: right center; }
}
.studio__tools button { touch-action: manipulation; }
