html, body { margin: 0; min-height: 100%; background: #120d1c; color: #fff; font: 700 15px Barlow, sans-serif; -webkit-tap-highlight-color: transparent; }
body.studio { background: radial-gradient(110% 60% at 50% 0%, #3a2160 0%, #160f26 55%, #0e0a18 100%) fixed; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.big { width: 100%; padding: 16px; border: 0; border-radius: 16px; font: 22px 'Russo One', sans-serif; }
.gold { color: #2a1400; background: linear-gradient(180deg, #ffd35a, #ff8a2a); box-shadow: 0 6px 0 #a44a00, 0 0 26px rgba(255, 150, 40, .45); }
.gold:active { transform: translateY(3px); box-shadow: 0 3px 0 #a44a00; }
.green { color: #062a10; background: linear-gradient(180deg, #8dffa8, #2fd66a); box-shadow: 0 6px 0 #138a3c, 0 0 22px rgba(80, 255, 140, .4); }
.purple { color: #fff; background: linear-gradient(180deg, #a35cff, #6a2bd6); box-shadow: 0 6px 0 #3d1580; }
.link { border: 0; background: none; color: #b9a6dd; font-size: 14px; text-decoration: underline; padding: 8px; }
.ghost { width: 100%; padding: 11px; border: 2px solid rgba(255, 255, 255, .25); border-radius: 12px; background: rgba(255, 255, 255, .05); font-size: 15px; }
/* ---------- home */
#home { max-width: 980px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px 40px; }
.top { display: flex; align-items: center; gap: 8px; padding: 6px 2px 12px; }
.logo { font: 24px 'Russo One', sans-serif; color: #fff; text-decoration: none; text-shadow: 0 3px 0 #2a0f50, 0 0 14px rgba(160, 90, 255, .6); }
.logo span { color: #ffd35a; }
.beta { font: 11px 'Russo One', sans-serif; font-style: normal; padding: 2px 7px; border-radius: 8px; background: #31b8e6; color: #062431; }
.hero-card { display: grid; gap: 10px; padding: 18px; border-radius: 22px; background: linear-gradient(135deg, #3a2266, #22163c); box-shadow: 0 0 0 2px #9a4dff, 0 14px 34px rgba(0, 0, 0, .45); }
.hero-card h1 { margin: 0; font: 28px 'Russo One', sans-serif; color: #ffd35a; text-shadow: 0 3px 0 #5a2a00; }
.hero-card p { margin: 6px 0 2px; opacity: .9; font-weight: 600; }
h2 { margin: 22px 2px 10px; font: 20px 'Russo One', sans-serif; }
.tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tabs h2 { flex: 1 1 100%; margin-bottom: 2px; }
.tabs button { margin: 0 0 10px; padding: 6px 12px; border: 0; border-radius: 10px; background: #2a1d44; color: #c9b6ee; }
.tabs button.on { background: #ffd35a; color: #2a1400; }
.row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.row .card { flex: 0 0 210px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 12px; }
.card { display: grid; gap: 6px; padding: 8px 8px 10px; border-radius: 16px; background: #22173a; box-shadow: 0 0 0 2px #ffffff14, 0 8px 18px rgba(0, 0, 0, .35); text-align: left; border: 0; }
.card img, .card canvas { width: 100%; aspect-ratio: 8 / 3; border-radius: 10px; display: block; background: #111; }
.card b { font: 16px 'Russo One', sans-serif; }
.card small { opacity: .75; font-weight: 600; }
.card .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font: 11px 'Russo One', sans-serif; padding: 2px 7px; border-radius: 7px; background: #3a2a5a; }
.tag.pub { background: #2fd66a; color: #062a10; } .tag.ex { background: #ffd35a; color: #2a1400; }
.card .btns { display: flex; gap: 6px; margin-top: 2px; }
.card .btns button { flex: 1; padding: 8px 6px; border: 0; border-radius: 10px; background: #3a2a5a; font-size: 14px; }
.card .btns button.main { background: linear-gradient(180deg, #ffd35a, #ff8a2a); color: #2a1400; }
.foot { margin-top: 30px; text-align: center; opacity: .6; font-weight: 600; font-size: 13px; }
/* ---------- editor */
#editor { position: fixed; inset: 0; background: #0e0a18; touch-action: none; user-select: none; -webkit-user-select: none; }
#view { position: absolute; left: 0; right: 0; top: calc(env(safe-area-inset-top, 0px) + 56px); bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); width: 100%; height: calc(100% - 152px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); touch-action: none; }
#editor.testing #view { top: 0; bottom: 0; height: 100%; }
#editor.testing .e-top, #editor.testing .palette, #editor.testing .e-hint { display: none; }
.e-top { position: absolute; left: 0; right: 0; top: 0; padding: calc(env(safe-area-inset-top, 0px) + 7px) 8px 7px; display: flex; gap: 6px; align-items: center; background: linear-gradient(180deg, #22163c, #1a1130); box-shadow: 0 2px 0 #9a4dff55; }
.e-top button { height: 42px; border: 0; border-radius: 12px; background: #33244f; }
.e-top .ico { width: 42px; font-size: 22px; flex: 0 0 auto; }
.e-top .title { flex: 1 1 auto; min-width: 0; padding: 0 10px; font: 16px 'Russo One', sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.e-top .test { padding: 0 14px; font: 16px 'Russo One', sans-serif; color: #062a10; background: linear-gradient(180deg, #8dffa8, #2fd66a); box-shadow: 0 3px 0 #138a3c; }
.e-top .pub { padding: 0 12px; font: 15px 'Russo One', sans-serif; color: #2a1400; background: linear-gradient(180deg, #ffd35a, #ff8a2a); box-shadow: 0 3px 0 #a44a00; }
.e-hint { position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 64px); transform: translateX(-50%); padding: 6px 12px; border-radius: 10px; background: rgba(10, 6, 20, .78); font-size: 13px; white-space: nowrap; pointer-events: none; transition: opacity .4s; }
.palette { position: absolute; left: 0; right: 0; bottom: 0; height: calc(96px + env(safe-area-inset-bottom, 0px)); padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)); box-sizing: border-box; display: flex; gap: 6px; overflow-x: auto; background: linear-gradient(0deg, #1a1130, #22163c); box-shadow: 0 -2px 0 #9a4dff55; -webkit-overflow-scrolling: touch; touch-action: pan-x; }
.tool { flex: 0 0 66px; display: grid; justify-items: center; align-content: center; gap: 3px; border: 0; border-radius: 14px; background: #2c1f46; font-size: 11.5px; padding: 6px 2px; }
.tool canvas { width: 40px; height: 40px; }
.tool.on { background: linear-gradient(180deg, #5a3a9a, #3a2470); box-shadow: 0 0 0 3px #ffd35a, 0 0 16px rgba(255, 210, 90, .5); }
/* ---------- the HUD in play */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.h-top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top, 0px) + 10px) 10px 0; }
.h-exit { pointer-events: auto; height: 40px; padding: 0 14px; border: 0; border-radius: 12px; background: rgba(20, 12, 36, .82); box-shadow: 0 0 0 2px #ffffff30; font: 15px 'Russo One', sans-serif; }
.h-prog { flex: 1; height: 12px; border-radius: 7px; background: rgba(10, 6, 20, .7); box-shadow: inset 0 0 0 2px #ffffff22; overflow: hidden; }
.h-prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #a35cff, #ffd35a); border-radius: 7px; transition: width .15s; }
.h-coins { display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 20px; background: rgba(20, 12, 36, .82); font: 19px 'Russo One', sans-serif; color: #ffd35a; }
.coin { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6b0, #ffc81e 45%, #c88a00); box-shadow: 0 0 10px rgba(255, 200, 30, .7); }
.h-coins b.pop { animation: pop .3s; } @keyframes pop { 50% { transform: scale(1.35); } }
.h-deaths { position: absolute; right: 12px; top: calc(env(safe-area-inset-top, 0px) + 58px); padding: 3px 10px; border-radius: 10px; background: rgba(20, 12, 36, .7); font-size: 13px; opacity: .85; }
.h-hint { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 18%); transform: translateX(-50%); padding: 10px 16px; border-radius: 14px; background: rgba(10, 6, 20, .8); font: 17px 'Russo One', sans-serif; white-space: nowrap; animation: breathe 1.2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: translateX(-50%) scale(1.06); } }
.h-toast { position: absolute; left: 50%; top: 26%; transform: translate(-50%, -10px) scale(.7); opacity: 0; font: 30px 'Russo One', sans-serif; color: #ffd35a; text-shadow: 0 3px 0 #5a2a00, 0 0 18px rgba(255, 180, 60, .6); white-space: nowrap; transition: opacity .15s, transform .25s cubic-bezier(.2, 1.6, .4, 1); }
.h-toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
/* ---------- sheets */
.sheet { position: fixed; inset: 0; z-index: 9; display: grid; place-items: center; background: rgba(8, 5, 16, .72); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet-in { width: min(92vw, 420px); max-height: 88vh; overflow-y: auto; box-sizing: border-box; padding: 20px 16px 16px; border-radius: 20px; background: linear-gradient(180deg, #2c1d45, #1a1229); box-shadow: 0 0 0 2px #9a4dff, 0 18px 50px rgba(0, 0, 0, .6); animation: popin .3s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes popin { from { transform: scale(.75); opacity: 0; } }
.sheet-in h2 { margin: 0 0 12px; text-align: center; font: 26px 'Russo One', sans-serif; color: #ffd35a; text-shadow: 0 3px 0 #5a2a00; }
#sh-body { display: grid; gap: 10px; }
#sh-body p { margin: 0; text-align: center; font-weight: 600; opacity: .9; }
#sh-body label { display: grid; gap: 5px; font-size: 13px; opacity: .9; }
#sh-body input, #sh-body textarea { box-sizing: border-box; width: 100%; padding: 11px 12px; border: 0; border-radius: 12px; background: #120a20; color: #fff; font: 600 16px Barlow, sans-serif; box-shadow: inset 0 0 0 2px #9a4dff66; }
#sh-body textarea { min-height: 70px; resize: vertical; }
.warn { color: #ff8a6a; font-weight: 700; text-align: center; min-height: 18px; }
.okline { color: #7dffb0; } .badline { color: #ff8a6a; }
.checks { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; background: #120a20; font-size: 14px; }
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.themes button { padding: 0 0 6px; border: 0; border-radius: 12px; background: #241938; overflow: hidden; font-size: 12px; display: grid; gap: 4px; }
.themes button canvas { width: 100%; height: 44px; display: block; }
.themes button.on { box-shadow: 0 0 0 3px #ffd35a; }
.seg { display: flex; gap: 6px; } .seg button { flex: 1; padding: 10px; border: 0; border-radius: 10px; background: #241938; } .seg button.on { background: #ffd35a; color: #2a1400; }
.result { display: flex; justify-content: center; gap: 14px; font: 22px 'Russo One', sans-serif; }
.result span { display: grid; justify-items: center; gap: 2px; } .result small { font: 700 12px Barlow, sans-serif; opacity: .75; }
.share { display: flex; gap: 6px; } .share input { flex: 1; } .share button { padding: 0 14px; border: 0; border-radius: 12px; background: #31b8e6; color: #062431; font: 15px 'Russo One', sans-serif; }
/* ---------- play page */
body.player { overflow: hidden; background: #0e0a18; touch-action: none; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; }
.cover { position: fixed; inset: 0; z-index: 8; display: grid; place-items: center; background: rgba(8, 5, 16, .55); }
.cover .sheet-in { text-align: center; }
.cover canvas { width: 100%; border-radius: 12px; aspect-ratio: 8 / 3; display: block; margin-bottom: 8px; }
.by { opacity: .8; font-weight: 600; }

/* ---------- the buttons are Venice-made plates (assets/studio/ui/btn_*.webp) with live text on top */
.gold, .green, .purple, .ghost, .tabs button, .seg button, .share button {
  border-style: solid !important; border-width: 0 !important; border-color: transparent !important; background: none !important; box-shadow: none !important;
  border-image-source: url(/assets/studio/ui/btn_dark.webp); border-image-slice: 0 80 fill !important; border-image-width: 0 22px; border-image-outset: 0; border-image-repeat: stretch !important; }
.gold { border-image-source: url(/assets/studio/ui/btn_gold.webp) !important; color: #3a1700 !important; text-shadow: 0 1px 0 rgba(255, 240, 180, .5); }
.green { border-image-source: url(/assets/studio/ui/btn_green.webp) !important; color: #032a0c !important; text-shadow: 0 1px 0 rgba(220, 255, 200, .45); }
.purple { border-image-source: url(/assets/studio/ui/btn_purple.webp) !important; color: #fff !important; text-shadow: 0 2px 0 rgba(40, 0, 80, .6); }
.ghost { border-image-source: url(/assets/studio/ui/btn_dark.webp) !important; color: #fff !important; }
.big { border-image-width: 0 30px !important; padding: 18px 26px; }
.gold:active, .green:active, .purple:active, .ghost:active, .tabs button:active, .seg button:active { transform: translateY(2px) scale(.98); filter: brightness(1.08); }
.tabs button { color: #e8dcff; padding: 8px 18px; } .tabs button.on { border-image-source: url(/assets/studio/ui/btn_gold.webp); color: #3a1700; }
.seg button { color: #fff; padding: 11px 14px; } .seg button.on { border-image-source: url(/assets/studio/ui/btn_gold.webp); color: #3a1700; }
.share button { border-image-source: url(/assets/studio/ui/btn_purple.webp); color: #fff; padding: 0 18px; }
.card .btns button { padding: 9px 8px; border-image-width: 0 18px !important; }
.e-top .ico { background: none !important; box-shadow: none !important; width: 44px; padding: 2px; }
.e-top .ico img { width: 34px; height: 34px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); }
.e-top .test, .e-top .pub { border-image-width: 0 21px !important; padding: 0 16px; display: flex; align-items: center; gap: 4px; }
.e-top .test img { width: 20px; height: 20px; }
.e-top .title { border-image-width: 0 21px !important; padding: 0 14px; }
.h-exit.ghost { border-image-width: 0 20px !important; padding: 0 18px; background: none; box-shadow: none; }
.h-exit.icon { background: none; box-shadow: none; padding: 0; width: 46px; } .h-exit.icon img { width: 42px; height: 42px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .6)); }
.coin { width: 30px; height: 30px; background: none; box-shadow: none; filter: drop-shadow(0 0 6px rgba(255, 200, 40, .6)); }
.tool img { width: 46px; height: 46px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .45)); pointer-events: none; }
.themes button img { width: 100%; height: 48px; object-fit: cover; display: block; }
.card img { object-fit: cover; }
.cover .cover-pic { width: 100%; aspect-ratio: 8 / 3; object-fit: cover; border-radius: 12px; display: block; margin-bottom: 8px; }

.e-top { gap: 4px; } .e-top .title { min-width: 64px; flex: 1 1 64px; } .e-top .test, .e-top .pub { padding: 0 12px; font-size: 14px; }
