root = Card([header, onlineCard, kpiCard, sessionCard, itemsCard, serversCard, crashCard, eventsCard, moderationCard, economyCard, experimentsCard, patchCard, focusCard, hotfixCard], "card", "column", "l")
header = CardHeader("Live Ops Dashboard", "Game Studio — Live Operations Room")
onlineCard = Card([onlineTitle, TextContent("**12,847**", "large-heavy"), TextContent("▲ 8% vs same time yesterday", "small")], "sunk", "column", "s")
onlineTitle = Heading("Players Online Right Now", "h3")
kpiCard = Card([dauStat, mauStat, revStat, arpuStat], "card", "row", "l")
dauStat = Card([TextContent("DAU", "small"), TextContent("**241,506**", "large-heavy")], "clear", "column")
mauStat = Card([TextContent("MAU", "small"), TextContent("**1,238,944**", "large-heavy")], "clear", "column")
revStat = Card([TextContent("Revenue Today", "small"), TextContent("**$84,210**", "large-heavy")], "clear", "column")
arpuStat = Card([TextContent("ARPU Today", "small"), TextContent("**$0.35**", "large-heavy")], "clear", "column")
sessionCard = Card([sessionHeader, sessionChart], "card", "column", "s")
sessionHeader = CardHeader("Avg Session Length — 14 Days", "minutes per player")
sessionChart = LineChart(["D1", "D2", "D3", "D4", "D5", "D6", "D7", "D8", "D9", "D10", "D11", "D12", "D13", "D14"], [sessionSeries], "natural", "Day", "Minutes")
sessionSeries = Series("Avg Session (min)", [18, 19, 21, 20, 22, 24, 23, 25, 27, 26, 28, 29, 31, 30])
itemsCard = Card([itemsHeader, itemsTable], "card", "column", "s")
itemsHeader = CardHeader("Best-Selling Items", "units sold today")
itemsTable = Table([itemCol, unitsCol, itemRevCol])
itemCol = Col("Item", ["Dragon Knight Bundle", "Mythic Loot Crate", "Season Pass", "Gems (10,000)", "Legendary Skin — Ember"])
unitsCol = Col("Units", [1240, 986, 745, 512, 430])
itemRevCol = Col("Revenue", ["$24,800", "$18,734", "$14,900", "$12,800", "$10,750"])
serversCard = Card([serversHeader, serversTable], "card", "column", "s")
serversHeader = CardHeader("Server Regions & Health", "players, health, latency")
serversTable = Table([serverRegionCol, serverStatusCol, serverPlayersCol, serverPingCol])
serverRegionCol = Col("Region", ["NA East", "NA West", "EU West", "EU Central", "APAC", "LATAM", "OCE"])
serverStatusCol = Col("Health", ["Healthy", "Healthy", "Degraded", "Healthy", "Healthy", "Warning", "Healthy"])
serverPlayersCol = Col("Players", [4210, 2890, 1980, 2240, 1240, 890, 540])
serverPingCol = Col("Ping (ms)", [24, 31, 42, 55, 89, 76, 63])
crashCard = Card([crashHeader, crashChart], "card", "column", "s")
crashHeader = CardHeader("Crash Rate by App Version", "last 24h, % of sessions")
crashChart = BarChart(["v2.4.0", "v2.4.1", "v2.5.0", "v2.5.1", "v2.5.2"], [crashSeries], "grouped", "Version", "Crash rate %")
crashSeries = Series("Crash rate", [0.8, 0.4, 1.2, 0.9, 0.3])
eventsCard = Card([eventsHeader, eventsTable], "card", "column", "s")
eventsHeader = CardHeader("Live Events", "running and upcoming")
eventsTable = Table([eventNameCol, eventTypeCol, eventStatusCol, eventEndCol])
eventNameCol = Col("Event", ["Festival of Frost", "Double XP Weekend", "Boss Rush: Infernal", "Spring Coin Hunt", "Community Capture"])
eventTypeCol = Col("Type", ["Seasonal", "Boost", "Challenge", "Economy", "PvP"])
eventStatusCol = Col("Status", ["Running", "Running", "Upcoming", "Upcoming", "Upcoming"])
eventEndCol = Col("Ends", ["Dec 24", "Dec 15", "Dec 18", "Dec 20", "Dec 27"])
moderationCard = Card([moderationHeader, reportsBlock, appealsBlock, moderationActions], "card", "column", "s")
moderationHeader = CardHeader("Moderation Queue", "awaiting review")
reportsBlock = Card([TextContent("Player reports", "default"), TextContent("**137**", "large-heavy")], "clear", "row", "l")
appealsBlock = Card([TextContent("Ban appeals", "default"), TextContent("**24**", "large-heavy")], "clear", "row", "l")
moderationActions = Buttons([reviewReportsBtn, reviewAppealsBtn])
reviewReportsBtn = Button("Review Player Reports")
reviewAppealsBtn = Button("Review Ban Appeals", null, "secondary")
economyCard = Card([economyHeader, inflationChart, inflationNote], "card", "column", "s")
economyHeader = CardHeader("In-Game Currency Inflation", "soft currency in circulation")
inflationChart = LineChart(["Sep", "Oct", "Nov", "Dec"], [currencySeries], "linear", "Month", "Billion")
currencySeries = Series("Currency in circulation", [18.2, 19.4, 21.6, 24.1])
inflationNote = Callout("warning", "Inflation rising 11% MoM", "The seasonal event is injecting currency faster than sinks. Consider tuning drop rates or adding a gold sink.")
experimentsCard = Card([experimentsHeader, experimentsTable], "card", "column", "s")
experimentsHeader = CardHeader("Running Experiments", "results")
experimentsTable = Table([expNameCol, expVariantCol, expLiftCol, expConfidenceCol])
expNameCol = Col("Experiment", ["Onboarding Flow", "Shop Discounting"])
expVariantCol = Col("Variant", ["Variant B (3-step)", "Variant A (10% bundle)"])
expLiftCol = Col("Lift", ["+6.2% D1 retention", "+4.1% revenue"])
expConfidenceCol = Col("Confidence", ["95%", "89%"])
patchCard = Card([patchHeader, patchForm], "card", "column", "s")
patchHeader = CardHeader("Draft Patch Notes", "release notes for v2.6.0")
patchForm = Form("patch-notes", patchButtons, [patchField])
patchField = FormControl("Patch notes", patchTextarea, "Supports markdown")
patchTextarea = TextArea("patch_notes", "## v2.6.0\n- Fixed crash on Android 14\n- Rebalanced Ember\n- Winter event bug fixes", 6)
patchButtons = Buttons([saveDraftBtn, previewPatchBtn])
saveDraftBtn = Button("Save Draft", null, "primary")
previewPatchBtn = Button("Preview", null, "secondary")
focusCard = Card([focusHeader, focusForm], "card", "column", "s")
focusHeader = CardHeader("Focus on a Region", "scope all metrics to one region")
focusForm = Form("focus-region", focusButtons, [focusField])
focusField = FormControl("Region", focusSelect)
focusSelect = Select("region", [regionNAE, regionNAW, regionEUW, regionEUC, regionAPAC, regionLATAM, regionOCE], "Select a region...")
regionNAE = SelectItem("na-east", "NA East")
regionNAW = SelectItem("na-west", "NA West")
regionEUW = SelectItem("eu-west", "EU West")
regionEUC = SelectItem("eu-central", "EU Central")
regionAPAC = SelectItem("apac", "APAC")
regionLATAM = SelectItem("latam", "LATAM")
regionOCE = SelectItem("oce", "OCE")
focusButtons = Buttons([focusApplyBtn])
focusApplyBtn = Button("Apply Focus", null, "primary")
hotfixCard = Card([hotfixHeader, hotfixAction, hotfixNote], "card", "column", "s")
hotfixHeader = CardHeader("Hotfix Deployment", "ship an emergency patch")
hotfixAction = AlertDialogBlock("Ship Hotfix", "Confirm hotfix deployment", "This will deploy to all regions and briefly restart matchmaking. Continue?", "Ship Hotfix", "Cancel", "destructive")
hotfixNote = TextContent("Last hotfix: v2.5.3 shipped 2h ago", "small")