root = Card([header, kpiSection, sessionSection, salesSection, regionsSection, focusSection, crashSection, eventsSection, moderationSection, economySection, experimentsSection, toolsSection], "card", "column", "l")
header = CardHeader("Live Ops Room", "Gamebase Console • Shift 2")
kpiSection = Card([kpiTitle, kpiTable], "sunk")
kpiTitle = Heading("Live KPIs", "h2")
kpiTable = Table([metricCol, valueCol])
metricCol = Col("Metric", ["Players Online", "Daily Active Players", "Monthly Active Players", "Revenue Today", "Revenue Per User"])
valueCol = Col("Value", ["128,430", "1.24M", "4.78M", "$348,210", "$0.28"])
sessionSection = Card([sessionTitle, sessionChart], "sunk")
sessionTitle = Heading("Average Session Length — Last 14 Days", "h2")
sessionChart = LineChart(["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], [sessionSeries], "natural", "Day", "Minutes")
sessionSeries = Series("Avg Session", [34, 32, 38, 36, 41, 52, 48, 42, 39, 44, 47, 55, 49, 46])
salesSection = Card([salesTitle, salesChart], "sunk")
salesTitle = Heading("Best-Selling Items (Today)", "h2")
salesChart = HorizontalBarChart(["Dragon Sword", "Mana Potion", "Speed Boots", "Shield Charm", "Gold Pack"], [salesSeries])
salesSeries = Series("Units Sold", [1240, 980, 756, 532, 410])
regionsSection = Card([regionsTitle, regionsTable], "sunk")
regionsTitle = Heading("Server Regions", "h2")
regionsTable = Table([regionCol, healthCol, latencyCol, playersCol])
regionCol = Col("Region", ["NA East", "NA West", "EU Central", "EU West", "Asia Pacific", "South America"])
healthCol = Col("Health", ["Healthy", "Healthy", "Degraded", "Healthy", "Healthy", "Offline"])
latencyCol = Col("Latency", ["22ms", "18ms", "95ms", "41ms", "120ms", "—"])
playersCol = Col("Players", ["18,302", "22,491", "9,875", "14,220", "7,540", "0"])
focusSection = Card([focusTitle, focusForm], "sunk")
focusTitle = Heading("Region Focus", "h2")
focusForm = Form("region-focus", focusButtons, [focusField])
focusField = FormControl("Focus on region", regionSelect, "Applies to all monitoring widgets on this screen")
regionSelect = Select("region", [regionNA, regionEU, regionAP, regionSA], "Select a region")
regionNA = SelectItem("na-east", "NA East")
regionEU = SelectItem("eu-central", "EU Central")
regionAP = SelectItem("apac", "Asia Pacific")
regionSA = SelectItem("south-america", "South America")
focusButtons = Buttons([applyFocusBtn])
applyFocusBtn = Button("Apply Focus", null, "primary")
crashSection = Card([crashTitle, crashChart], "sunk")
crashTitle = Heading("Crash Rate by App Version", "h2")
crashChart = BarChart(["1.7.2", "1.7.1", "1.7.0", "1.6.9", "1.6.8"], [crashSeries], "grouped", "Version", "Crash rate %")
crashSeries = Series("Crash Rate (%)", [0.42, 0.31, 0.58, 0.22, 0.19])
eventsSection = Card([eventsTitle, eventsTable], "sunk")
eventsTitle = Heading("Live Events", "h2")
eventsTable = Table([eventCol, statusCol, countdownCol])
eventCol = Col("Event", ["Season 5: Solstice Hunt", "Double XP Weekend", "Return of the Dragon Raid", "Summer Carnival"])
statusCol = Col("Status", ["Live", "Live", "Upcoming", "Upcoming"])
countdownCol = Col("Schedule", ["Ends in 2d 4h", "Ends in 12h", "Starts tomorrow", "Starts Jul 28"])
moderationSection = Card([moderationTitle, reportsCallout, appealsCallout], "sunk")
moderationTitle = Heading("Moderation Queue", "h2")
reportsCallout = Callout("warning", "1,342 Player Reports", "Awaiting review • oldest 3h 20m")
appealsCallout = Callout("info", "89 Ban Appeals", "Awaiting review • oldest 1d 2h")
economySection = Card([economyTitle, inflationMetric, inflationChart], "sunk")
economyTitle = Heading("In-Game Currency Inflation", "h2")
inflationMetric = TextContent("Current inflation rate: **3.2%** month over month", "default")
inflationChart = AreaChart(["Jan", "Feb", "Mar", "Apr", "May", "Jun"], [currencySeries], "natural", "Month", "Gold in circulation (M)")
currencySeries = Series("Gold supply", [120, 132, 141, 158, 169, 184])
experimentsSection = Card([experimentsTitle, experimentsTable], "sunk")
experimentsTitle = Heading("Running Experiments", "h2")
experimentsTable = Table([expCol, variantCol, metricCol, resultCol])
expCol = Col("Experiment", ["Matchmaking 2.0", "Battle Pass Pricing"])
variantCol = Col("Variant", ["10% wider skill range", "Tier 20% off"])
metricCol = Col("Metric", ["Win rate balance", "Conversion"])
resultCol = Col("Result", ["+1.8% retention • significant", "+4.2% revenue • significant"])
toolsSection = Card([toolsTitle, patchDialog, hotfixDialog], "sunk")
toolsTitle = Heading("Ops Tools", "h2")
patchDialog = DialogBlock("Draft Patch Notes", "Patch Notes Draft", "Write release notes for the next patch.", [patchForm])
patchForm = Form("patch-notes", patchButtons, [patchField])
patchField = FormControl("Patch notes", patchTextArea, "Markdown supported")
patchTextArea = TextArea("notes", "## 1.7.3\n- Fixed crash on Android\n- Balanced Dragon Sword", 8)
patchButtons = Buttons([saveDraftBtn, discardBtn])
saveDraftBtn = Button("Save Draft", null, "primary")
discardBtn = Button("Discard", null, "tertiary")
hotfixDialog = AlertDialogBlock("Ship Hotfix", "Deploy hotfix to all regions?", "This will restart matchmaking pools and push build 1.7.3 to 100% of players.", "Ship Hotfix", "Cancel", "destructive")