/* VB Platform — Safari-compatible CSS (iOS 9+) */
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; padding: 0;
  font-family: "Cairo", Tahoma, Arial, sans-serif;
  background: #0c0f14; color: #e8ecf4;
  line-height: 1.65; min-height: 100%;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
* { -webkit-box-sizing: border-box; box-sizing: border-box; }

/* Welcome */
#stage-welcome {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-orient: vertical; -webkit-box-direction: normal;
  -webkit-flex-direction: column; flex-direction: column;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center;
  padding: 24px;
  -webkit-transition: opacity 0.5s ease, -webkit-transform 0.5s ease;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
#stage-welcome.is-leaving {
  opacity: 0;
  -webkit-transform: scale(1.04) translateY(-12px);
  transform: scale(1.04) translateY(-12px);
  pointer-events: none;
}
.welcome-bg {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; overflow: hidden;
  background: #0c0f14;
  background: -webkit-radial-gradient(ellipse 80% 60% at 50% 0%, #1a1030 0%, #0c0f14 70%);
  background: radial-gradient(ellipse 80% 60% at 50% 0%, #1a1030 0%, #0c0f14 70%);
}
.welcome-grid {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background-image: linear-gradient(rgba(124,77,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,77,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}
.welcome-orb { position: absolute; border-radius: 50%; pointer-events: none; opacity: 0.35; }
.welcome-orb-1 { width: 280px; height: 280px; background: #5c2d91; top: -60px; right: -30px; }
.welcome-orb-2 { width: 200px; height: 200px; background: #0e7490; bottom: 5%; left: -40px; opacity: 0.2; }
.welcome-inner { position: relative; z-index: 2; text-align: center; max-width: 420px; width: 100%; }
.vb-mark { margin: 0 auto 20px; width: 72px; height: 72px; }
.vb-mark-box {
  width: 72px; height: 72px; border-radius: 16px; background: #5c2d91;
  color: #fff; font-family: Arial Black, Arial, sans-serif; font-size: 26px; font-weight: 900;
  line-height: 72px; text-align: center;
  -webkit-box-shadow: 0 8px 24px rgba(92,45,145,0.4); box-shadow: 0 8px 24px rgba(92,45,145,0.4);
}
.welcome-title { font-size: 26px; font-weight: 800; line-height: 1.3; margin: 0 0 8px; }
@media (min-width: 480px) { .welcome-title { font-size: 34px; } }
.welcome-name { display: block; margin-top: 4px; color: #c4b5fd; }
.welcome-lead { color: #8b95a8; font-size: 16px; margin: 0 0 32px; }
.swipe { width: 100%; max-width: 300px; margin: 0 auto; }
.swipe-track {
  position: relative; height: 56px; background: #1a1f2a; border: 1px solid #2a3140;
  border-radius: 999px; overflow: hidden;
  -ms-touch-action: none; touch-action: none;
  -webkit-user-select: none; user-select: none;
}
.swipe-progress {
  position: absolute; top: 0; right: 0; bottom: 0; width: 0%;
  background: rgba(124,77,255,0.25); border-radius: 999px; pointer-events: none;
}
.swipe-label {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center;
  color: #8b95a8; font-size: 14px; font-weight: 500; pointer-events: none;
}
.swipe-thumb {
  position: absolute; top: 4px; right: 4px; width: 48px; height: 48px; border-radius: 50%;
  background: #6d28d9; color: #fff;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center;
  -webkit-box-shadow: 0 4px 16px rgba(109,40,217,0.5); box-shadow: 0 4px 16px rgba(109,40,217,0.5);
  cursor: pointer; z-index: 2;
  -webkit-transition: -webkit-box-shadow 0.2s; transition: box-shadow 0.2s;
}
.swipe-arrow { font-size: 20px; font-weight: bold; line-height: 1; }
.swipe-alt {
  display: block; margin: 16px auto 0; color: #8b95a8; font-size: 13px;
  text-decoration: underline; background: none; border: none; cursor: pointer;
}
.welcome-foot { position: absolute; bottom: 20px; color: #8b95a8; font-size: 12px; opacity: 0.6; }

/* Main */
.main-app {
  min-height: 100%; min-height: -webkit-fill-available;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-orient: vertical; -webkit-box-direction: normal;
  -webkit-flex-direction: column; flex-direction: column;
  padding-bottom: 64px;
}
.topbar {
  position: -webkit-sticky; position: sticky; top: 0; z-index: 40; height: 56px;
  background: rgba(12,15,20,0.92); border-bottom: 1px solid #2a3140;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  padding: 0 16px;
}
.topbar-brand {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  font-weight: 700;
}
.topbar-logo {
  width: 32px; height: 32px; background: #5c2d91; border-radius: 8px;
  text-align: center; line-height: 32px; font-size: 12px; font-weight: 800; margin-left: 8px;
}
.topbar-title { font-size: 14px; }
@media (max-width: 520px) { .topbar-title { display: none; } }
.topbar-steps {
  display: -webkit-box; display: -webkit-flex; display: flex;
  margin: 0 auto;
}
.step-dot {
  width: 10px; height: 10px; border-radius: 50%; background: #2a3140; margin: 0 4px;
  border: none; padding: 0; cursor: pointer;
}
.step-dot.is-active { background: #7c4dff; -webkit-transform: scale(1.25); transform: scale(1.25); }
.step-dot.is-done { background: #3dd68c; }
.topbar-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: #2a3140; }
.topbar-fill { height: 100%; width: 0%; background: #7c4dff; -webkit-transition: width 0.4s ease; transition: width 0.4s ease; }

.content { -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 20px 16px 24px; overflow-x: hidden; }
.panel-head { margin-bottom: 20px; }
.panel-head h2 { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.panel-head p { color: #8b95a8; font-size: 14px; margin: 0; }

.bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; height: 64px;
  background: rgba(12,15,20,0.95); border-top: 1px solid #2a3140;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  -webkit-box-pack: justify; -webkit-justify-content: space-between; justify-content: space-between;
  padding: 0 16px;
}
.btn {
  display: inline-block; min-height: 44px; line-height: 44px; padding: 0 20px;
  border-radius: 999px; font-weight: 700; font-size: 14px; text-align: center;
  border: none; cursor: pointer; min-width: 100px;
}
.btn-primary { background: #6d28d9; color: #fff; }
.btn-ghost { background: #1a1f2a; color: #e8ecf4; border: 1px solid #2a3140; }
.btn-sm {
  min-height: 32px; line-height: 32px; padding: 0 12px; border-radius: 8px;
  font-size: 12px; font-weight: 600; background: #1a1f2a; border: 1px solid #2a3140; color: #e8ecf4; cursor: pointer;
}

.prose { max-width: 38em; }
.prose h3 { font-size: 16px; font-weight: 700; margin: 24px 0 8px; color: #c4b5fd; }
.prose h3:first-child { margin-top: 0; }
.prose p { color: #8b95a8; margin: 0 0 10px; font-size: 15px; }
.prose strong { color: #e8ecf4; font-weight: 600; }
.prose ul { margin: 6px 0 12px; padding-right: 18px; list-style: disc; }
.prose li { color: #8b95a8; margin-bottom: 4px; font-size: 14px; }
.timeline { margin: 10px 0 18px; border-right: 2px solid #2a3140; padding-right: 16px; }
.timeline-item { margin-bottom: 14px; position: relative; overflow: hidden; }
.timeline-item:before {
  content: ""; position: absolute; right: -21px; top: 6px;
  width: 8px; height: 8px; border-radius: 50%; background: #7c4dff;
}
.timeline-year { display: inline-block; width: 48px; font-size: 12px; font-weight: 700; color: #7c4dff; font-family: monospace; vertical-align: top; }
.timeline-item strong { display: block; font-size: 14px; margin-bottom: 2px; }
.timeline-item p { margin: 0; font-size: 13px; }

.example-tabs { margin-bottom: 14px; overflow: hidden; }
.example-tab {
  display: inline-block; min-height: 34px; line-height: 34px; padding: 0 14px;
  border-radius: 999px; background: #12161e; border: 1px solid #2a3140;
  font-size: 13px; font-weight: 600; margin: 0 0 6px 6px; cursor: pointer; color: #e8ecf4;
}
.example-tab.is-active { background: rgba(124,77,255,0.15); border-color: #7c4dff; color: #c4b5fd; }

/* Design: flex fallback for 2-col (tools | form) — always side by side */
.designer {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-orient: horizontal; -webkit-box-direction: normal;
  -webkit-flex-direction: row; flex-direction: row;
  min-height: 320px;
}
.designer-tools {
  width: 88px; -webkit-flex-shrink: 0; flex-shrink: 0;
  background: #12161e; border: 1px solid #2a3140; border-radius: 12px;
  padding: 6px; margin-right: 8px;
  position: -webkit-sticky; position: sticky; top: 64px;
  max-height: 70vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.tool-list { }
.tool-item {
  display: block; min-height: 48px; padding: 6px 2px; margin-bottom: 4px;
  background: #1a1f2a; border: 1px solid transparent; border-radius: 8px;
  font-size: 11px; font-weight: 600; text-align: center; cursor: pointer;
  -ms-touch-action: none; touch-action: none;
  -webkit-user-select: none; user-select: none; color: #e8ecf4; line-height: 1.2;
}
.tool-item:active { opacity: 0.5; }
.tool-item .tool-icon { display: block; font-size: 14px; margin-bottom: 2px; }

.designer-main {
  -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; min-width: 0;
  background: #1e2430; border: 1px solid #2a3140; border-radius: 12px; overflow: hidden;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-orient: vertical; -webkit-box-direction: normal;
  -webkit-flex-direction: column; flex-direction: column;
}
.form-chrome {
  padding: 6px 10px; background: #2a3344; border-bottom: 1px solid #3a4556;
  font-size: 12px; overflow: hidden;
}
.form-chrome-title { float: left; }
.form-chrome-btns { float: right; }
.form-chrome-btns i {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #64748b; margin-left: 4px;
}
.form-chrome-btns i:first-child { background: #ef4444; }
.form-chrome-btns i:nth-child(2) { background: #f59e0b; }
.form-chrome-btns i:nth-child(3) { background: #22c55e; }
.form-surface {
  position: relative; -webkit-box-flex: 1; -webkit-flex: 1; flex: 1;
  min-height: 240px; background: #f0f2f5; color: #1a1d23; overflow: hidden;
  -ms-touch-action: none; touch-action: none;
}
.form-empty {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  text-align: center; color: #94a3b8; font-size: 13px; padding: 40px 16px; pointer-events: none;
}
.form-surface.has-items .form-empty { display: none; }
.designer-toolbar {
  padding: 6px 8px; border-top: 1px solid #3a4556; background: #1a2030; overflow: hidden;
}
.designer-toolbar .btn-sm { margin-left: 6px; }
.size-readout { float: right; font-size: 12px; color: #8b95a8; font-family: monospace; line-height: 32px; }

.c-item {
  position: absolute; font-family: "Segoe UI", Tahoma, Arial, sans-serif; font-size: 13px;
  cursor: move; border: 1px solid #94a3b8; background: #fff; min-width: 60px; min-height: 24px;
  -ms-touch-action: none; touch-action: none;
  -webkit-user-select: none; user-select: none;
}
.c-item.is-selected { outline: 2px solid #3b82f6; z-index: 5; }
.c-item-label { background: transparent; border: none; color: #1a1d23; padding: 2px 4px; }
.c-item-button {
  background: #e2e8f0; text-align: center; padding: 4px 10px; border-radius: 3px;
}
.c-item-textbox, .c-item-combobox, .c-item-numeric {
  background: #fff; border: 1px solid #64748b; padding: 2px 6px; min-width: 80px;
}
.c-item-listbox {
  background: #fff; border: 1px solid #64748b; padding: 4px; min-width: 100px; min-height: 50px;
  color: #64748b; font-size: 11px;
}
.c-item-checkbox { background: transparent; border: none; padding: 2px 4px; }

.c-handle {
  position: absolute; width: 12px; height: 12px; background: #3b82f6;
  border: 2px solid #fff; border-radius: 2px; z-index: 6;
  -ms-touch-action: none; touch-action: none;
}
.c-handle-nw { top: -6px; left: -6px; cursor: nwse-resize; }
.c-handle-n { top: -6px; left: 50%; margin-left: -6px; cursor: ns-resize; }
.c-handle-ne { top: -6px; right: -6px; cursor: nesw-resize; }
.c-handle-e { top: 50%; right: -6px; margin-top: -6px; cursor: ew-resize; }
.c-handle-se { bottom: -6px; right: -6px; cursor: nwse-resize; }
.c-handle-s { bottom: -6px; left: 50%; margin-left: -6px; cursor: ns-resize; }
.c-handle-sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.c-handle-w { top: 50%; left: -6px; margin-top: -6px; cursor: ew-resize; }

.designer-props {
  margin-top: 12px; background: #12161e; border: 1px solid #2a3140; border-radius: 12px; padding: 12px;
}
.designer-label { font-size: 11px; font-weight: 700; color: #8b95a8; margin: 0 0 8px; text-transform: uppercase; }
.empty-state { color: #8b95a8; font-size: 13px; margin: 0; }
.prop-row { padding: 6px 0; border-bottom: 1px solid #2a3140; font-size: 13px; overflow: hidden; }
.prop-row span { color: #8b95a8; }
.prop-row .prop-val { float: left; color: #e8ecf4; }
.prop-actions { margin-top: 10px; overflow: hidden; }
.prop-actions .btn-sm { margin: 0 0 6px 6px; }
.prop-edit-input, .prop-num-input {
  width: 100%; margin-top: 6px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid #2a3140; background: #1a1f2a; color: #e8ecf4; font: inherit; font-size: 14px;
  -webkit-appearance: none; appearance: none;
}
.prop-nums { margin-top: 8px; overflow: hidden; }
.prop-nums > div { width: 48%; float: right; }
.prop-nums > div:first-child { float: left; }
.prop-nums label { font-size: 12px; color: #8b95a8; display: block; margin-bottom: 2px; }

.target-details {
  margin-top: 14px; background: #12161e; border: 1px solid #2a3140; border-radius: 12px; padding: 12px 14px;
}
.target-details-title { font-size: 14px; font-weight: 600; color: #8b95a8; margin-bottom: 10px; }
.target-card {
  position: relative; overflow: hidden; background: #f0f2f5; color: #1a1d23;
  border-radius: 8px; border: 1px solid #cbd5e1; padding: 16px;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif; font-size: 13px;
}
.target-row { margin-bottom: 12px; }
.target-row:last-child { margin-bottom: 0; }
.target-label { display: block; font-weight: 600; color: #334155; margin-bottom: 6px; }
.target-field {
  display: block; width: 100%; min-height: 28px; background: #fff;
  border: 1px solid #94a3b8; border-radius: 3px; padding: 4px 8px;
  -webkit-box-sizing: border-box; box-sizing: border-box;
}
.target-list {
  display: block; width: 100%; min-height: 72px; background: #fff;
  border: 1px solid #94a3b8; border-radius: 3px; padding: 8px; color: #64748b; font-size: 12px;
  -webkit-box-sizing: border-box; box-sizing: border-box;
}
.target-actions { overflow: hidden; margin-top: 4px; }
.target-btn {
  display: inline-block; background: #e2e8f0; border: 1px solid #94a3b8; border-radius: 3px;
  padding: 6px 14px; font-size: 13px; margin: 0 0 6px 6px; white-space: nowrap;
}
.target-row-search { overflow: hidden; }
.target-row-search .target-label { display: inline-block; margin-left: 8px; vertical-align: middle; }
.target-row-search .target-field { display: inline-block; width: 50%; vertical-align: middle; min-width: 100px; }
.target-row-search .target-btn { vertical-align: middle; }

/* Code */
.code-lab { background: #12161e; border: 1px solid #2a3140; border-radius: 12px; padding: 16px; }
.code-lab-head { margin-bottom: 14px; }
.code-lab-head h3 { font-size: 16px; margin: 0 0 4px; }
.code-lab-head p { color: #8b95a8; font-size: 13px; margin: 0; }
.code-board {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-orient: horizontal; -webkit-box-direction: normal;
  -webkit-flex-direction: row; flex-direction: row;
}
@media (max-width: 560px) {
  .code-board {
    -webkit-box-orient: vertical; -webkit-box-direction: normal;
    -webkit-flex-direction: column; flex-direction: column;
  }
  .code-bank, .code-assembly { width: 100% !important; margin-bottom: 12px; }
}
.code-bank, .code-assembly { -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; min-width: 0; margin-left: 8px; }
.code-bank { margin-left: 0; margin-right: 8px; }
.code-board-label { font-size: 11px; font-weight: 700; color: #8b95a8; margin: 0 0 8px; text-transform: uppercase; }
.code-pieces, .code-slots {
  min-height: 200px; border-radius: 10px; padding: 8px;
}
.code-pieces { background: #1a1f2a; border: 1px solid #2a3140; }
.code-slots { background: #0d1117; border: 1px solid #30363d; }
.piece, .slot-piece {
  background: #12161e; border: 1px solid #2a3140; border-radius: 6px;
  padding: 8px 10px; margin-bottom: 6px; font-family: monospace; font-size: 12px;
  direction: ltr; text-align: left; cursor: pointer;
  white-space: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
  max-width: 100%; color: #e8ecf4;
  -ms-touch-action: none; touch-action: none;
  -webkit-user-select: none; user-select: none;
}
.piece.is-used { display: none; }
.slot-piece { background: rgba(56,139,253,0.1); border-color: #388bfd; }
.slot {
  min-height: 36px; border: 1px dashed #30363d; border-radius: 6px; margin-bottom: 6px; padding: 2px;
}
.slot.is-filled { border-style: solid; border-color: #388bfd; }
.slot.is-ok { border-color: #3dd68c; background: rgba(61,214,140,0.08); }
.slot.is-bad { border-color: #f07178; background: rgba(240,113,120,0.08); }
.code-actions { margin-top: 14px; overflow: hidden; }
.code-actions .btn { margin: 0 0 8px 8px; }
.code-feedback {
  margin-top: 12px; padding: 10px 14px; border-radius: 10px; font-weight: 600; font-size: 14px;
}
.code-feedback.is-ok { background: rgba(61,214,140,0.12); color: #3dd68c; border: 1px solid rgba(61,214,140,0.3); }
.code-feedback.is-bad { background: rgba(240,113,120,0.1); color: #f07178; border: 1px solid rgba(240,113,120,0.25); }
.code-result {
  margin-top: 14px; background: #0d1117; border: 1px solid #30363d; border-radius: 10px; padding: 14px;
}
.code-result h4 { font-size: 14px; margin: 0 0 8px; }
.code-result pre {
  direction: ltr; text-align: left; overflow-x: auto; -webkit-overflow-scrolling: touch;
  font-family: monospace; font-size: 12px; line-height: 1.55; color: #e6edf3; margin: 0;
}
.code-explain { margin-top: 10px; font-size: 13px; color: #8b95a8; line-height: 1.65; }
.code-explain p { margin: 0 0 6px; }
.code-explain strong { color: #e8ecf4; }

/* Team */
.team-list { overflow: hidden; }
.team-card {
  width: 46%; float: right; margin: 0 0 12px 2%;
  background: #12161e; border: 1px solid #2a3140; border-radius: 12px;
  padding: 16px; text-align: center;
  -webkit-box-sizing: border-box; box-sizing: border-box;
}
@media (min-width: 600px) {
  .team-card { width: 31%; margin-left: 2%; }
}
.team-avatar {
  width: 56px; height: 56px; border-radius: 50%; background: #5c2d91;
  margin: 0 auto 10px; line-height: 56px; font-size: 18px; font-weight: 800; color: #fff;
}
.team-card h3 { font-size: 14px; font-weight: 700; margin: 0 0 2px; }
.team-role { color: #8b95a8; font-size: 12px; margin: 0 0 12px; }
.tt-swipe {
  width: 100%; height: 44px; background: #1a1f2a; border: 1px solid #2a3140;
  border-radius: 999px; position: relative; overflow: hidden;
  -ms-touch-action: none; touch-action: none;
}
.tt-swipe.is-disabled { opacity: 0.5; }
.tt-label {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  text-align: center; line-height: 44px; font-size: 12px; color: #8b95a8; pointer-events: none;
}
.tt-thumb {
  position: absolute; top: 2px; right: 2px; width: 40px; height: 40px; border-radius: 50%;
  background: #000; color: #fff; text-align: center; line-height: 40px; font-size: 11px; font-weight: bold;
  cursor: pointer; z-index: 2;
}
.tt-note { margin-top: 6px; font-size: 11px; color: #8b95a8; }

.drag-ghost {
  position: fixed; z-index: 1000; pointer-events: none; opacity: 0.9;
  max-width: 80%; -webkit-box-shadow: 0 8px 24px rgba(0,0,0,0.4); box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

@media (max-width: 390px) {
  .content { padding: 14px 10px 20px; }
  .designer-tools { width: 72px; }
  .tool-item { min-height: 44px; font-size: 10px; }
  .bottom-bar .btn { min-width: 80px; padding: 0 12px; font-size: 13px; }
  .team-card { width: 100%; float: none; margin: 0 0 12px; }
}

/* ── Team photos ── */
.team-list { overflow: hidden; margin: 0 -1%; }
.team-card {
  width: 48%; float: right; margin: 0 1% 16px;
  background: #12161e; border: 1px solid #2a3140; border-radius: 12px;
  padding: 16px 12px; text-align: center;
  -webkit-box-sizing: border-box; box-sizing: border-box;
}
@media (min-width: 640px) {
  .team-card { width: 31.33%; margin: 0 1% 16px; }
}
.team-photo-wrap {
  width: 88px; height: 88px; margin: 0 auto 12px;
  border-radius: 50%; overflow: hidden; background: #2a3140;
  position: relative;
}
.team-photo {
  width: 88px; height: 88px;
  object-fit: cover;
  -o-object-fit: cover;
  display: block;
  border-radius: 50%;
}
.team-photo-fallback:after {
  content: attr(data-initial);
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  text-align: center; line-height: 88px;
  font-size: 28px; font-weight: 800; color: #c4b5fd;
  background: #2a3140; border-radius: 50%;
}
.team-name { font-size: 14px; font-weight: 700; margin: 0 0 4px; color: #e8ecf4; }
.team-role { color: #8b95a8; font-size: 12px; margin: 0 0 12px; }
.team-tiktok-btn {
  display: inline-block; min-height: 36px; line-height: 36px; padding: 0 14px;
  border-radius: 999px; background: #000; color: #fff; font-size: 12px; font-weight: 600;
  text-decoration: none; border: 1px solid #333;
  direction: ltr; unicode-bidi: embed;
}
.team-tiktok-btn .tt-icon {
  display: inline-block; width: 18px; height: 18px; line-height: 18px;
  background: #fe2c55; border-radius: 4px; font-size: 9px; font-weight: 800;
  text-align: center; vertical-align: middle; margin-left: 4px;
}
.team-tiktok-btn.is-disabled {
  background: #1a1f2a; color: #8b95a8; border-color: #2a3140; cursor: default;
}
@media (max-width: 390px) {
  .team-card { width: 48%; padding: 12px 8px; }
  .team-photo-wrap, .team-photo { width: 72px; height: 72px; }
  .team-photo-fallback:after { line-height: 72px; font-size: 22px; }
  .team-name { font-size: 12px; }
}

/* Team intro + TikTok logo buttons */
.team-intro {
  width: 100%; float: none; clear: both;
  text-align: center; color: #c4b5fd; font-size: 14px; font-weight: 600;
  margin: 0 0 18px; line-height: 1.5; padding: 0 8px;
}
.team-tiktok-btn {
  display: inline-block; min-height: 38px; line-height: 38px; padding: 0 16px;
  border-radius: 999px; background: #010101; color: #fff; font-size: 12px; font-weight: 600;
  text-decoration: none; border: 1px solid #333;
  direction: ltr; unicode-bidi: embed;
  -webkit-transition: background 0.2s, -webkit-transform 0.15s;
  transition: background 0.2s, transform 0.15s;
}
.team-tiktok-btn:hover, .team-tiktok-btn:focus {
  background: #fe2c55; border-color: #fe2c55; color: #fff;
  -webkit-transform: translateY(-1px); transform: translateY(-1px);
}
.team-tiktok-btn .tt-logo {
  display: inline-block; vertical-align: middle; margin-right: 6px;
  width: 16px; height: 16px;
}
.team-tiktok-btn .tt-handle {
  display: inline-block; vertical-align: middle;
}
.team-tiktok-btn.is-disabled {
  background: #1a1f2a; color: #8b95a8; border-color: #2a3140; cursor: default;
}
.team-role { display: none !important; }

/* Code pieces drag fix */
.piece {
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
  z-index: 1;
}
.piece:active { cursor: grabbing; }
.code-pieces { position: relative; z-index: 2; }
.code-slots .slot { min-height: 40px; }
.drag-ghost {
  position: fixed !important;
  z-index: 9999 !important;
  pointer-events: none !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}

/* Code system tabs (login / db / shop) */
.code-system-tabs { margin-bottom: 12px; overflow: hidden; }
.code-system-tab {
  display: inline-block; min-height: 34px; line-height: 34px; padding: 0 14px;
  border-radius: 999px; background: #12161e; border: 1px solid #2a3140;
  font-size: 13px; font-weight: 600; margin: 0 0 6px 6px; cursor: pointer; color: #e8ecf4;
}
.code-system-tab.is-active {
  background: rgba(124,77,255,0.15); border-color: #7c4dff; color: #c4b5fd;
}
