root = Card([header, online, activity, revenue, revenuePerUser, sessionTrend, bestSellers, regions, crashVersions, liveEvents, reports, banAppeals, inflation, experiments, patchNotes, hotfix, focusRegion])

header = CardHeader("Live-Ops Command Center", "Game Studio Real-Time Operations")

online = Card([onlineHeading, onlineValue, onlineSpark], "sunk")
onlineHeading = Heading("Players Online Right Now", "h3")
onlineValue = TextContent("128,437", "large-heavy")
onlineSpark = LineChart(["00:00", "02:00", "04:00", "06:00", "08:00", "10:00", "12:00", "14:00", "16:00", "18:00", "20:00", "22:00"], [onlineSeries], "natural", "Time", "Players")
onlineSeries = Series("Online", [95000, 88000, 72000, 65000, 84000, 110000, 125000, 118000, 104000, 96000, 132000, 128000])

activity = Card([activityHeading, activityTable], "sunk")
activityHeading = Heading("Active Players", "h3")
activityTable = Table([metricCol, valueCol])
metricCol = Col("Metric", ["Daily Active Players", "Monthly Active Players"])
valueCol = Col("Value", ["1,842,391", "12,406,220"])

revenue = Card([revenueHeading, revenueValue], "sunk")
revenueHeading = Heading("Revenue Today", "h3")
revenueValue = TextContent("$482,910", "large-heavy")

revenuePerUser = Card([arpuHeading, arpuValue], "sunk")
arpuHeading = Heading("Revenue Per User (Today)", "h3")
arpuValue = TextContent("$0.26", "large-heavy")

sessionTrend = Card([sessionHeading, sessionChart], "sunk")
sessionHeading = Heading("Average Session Length — Last 14 Days", "h3")
sessionChart = AreaChart(["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, 24, 26, 28, 27, 29, 30])

bestSellers = Card([bestHeading, bestTable], "sunk")
bestHeading = Heading("Best-Selling Items", "h3")
bestTable = Table([itemCol, unitsCol])
itemCol = Col("Item", ["Dragon Skin Pack", "Mega Loot Box", "Season Pass", "Starter Bundle", "Rare Charm Set"])
unitsCol = Col("Units", [8420, 7315, 6520, 4980, 3610])

regions = Card([regionsHeading, regionsTable], "sunk")
regionsHeading = Heading("Server Regions & Health", "h3")
regionsTable = Table([regionCol, healthCol, latencyCol, playersCol])
regionCol = Col("Region", ["US East", "US West", "EU Central", "AP Southeast", "South America", "Oceania"])
healthCol = Col("Health", ["Operational", "Operational", "Degraded", "Operational", "Operational", "Operational"])
latencyCol = Col("Latency (ms)", [42, 55, 68, 120, 95, 140])
playersCol = Col("Players", [38120, 22450, 31580, 18240, 12400, 5647])

crashVersions = Card([crashHeading, crashChart], "sunk")
crashHeading = Heading("Crash Rate by App Version", "h3")
crashChart = BarChart(["v2.4.1", "v2.4.2", "v2.4.3", "v2.5.0"], [crashSeries], "grouped", "Version", "Crash Rate (%)")
crashSeries = Series("Crash Rate", [0.3, 0.2, 0.1, 0.8])

liveEvents = Card([eventsHeading, eventsList], "sunk")
eventsHeading = Heading("Live Events", "h3")
eventsList = ListBlock([eventLive, eventUpcoming1, eventUpcoming2], "number")
eventLive = ListItem("Summer Festival", "Running now — ends in 3 days", null, "View")
eventUpcoming1 = ListItem("Double XP Weekend", "Starts Friday 00:00 UTC", null, "View")
eventUpcoming2 = ListItem("Boss Invasion", "Starts next Monday", null, "View")

reports = Card([reportsHeading, reportsValue], "sunk")
reportsHeading = Heading("Player Reports Awaiting Review", "h3")
reportsValue = TextContent("1,284", "large-heavy")

banAppeals = Card([appealsHeading, appealsValue], "sunk")
appealsHeading = Heading("Ban Appeals Awaiting Review", "h3")
appealsValue = TextContent("342", "large-heavy")

inflation = Card([inflationHeading, inflationValue, inflationCallout], "sunk")
inflationHeading = Heading("In-Game Currency Inflation", "h3")
inflationValue = TextContent("+4.2% this month", "large-heavy")
inflationCallout = Callout("warning", "Inflation rising", "Currency supply is growing 4.2% month-over-month; consider sink events.")

experiments = Card([expHeading, expTable], "sunk")
expHeading = Heading("Running Experiments", "h3")
expTable = Table([expNameCol, expResultCol, expStatusCol])
expNameCol = Col("Experiment", ["Matchmaking Tweak", "Store Price Test"])
expResultCol = Col("Result", ["+3% retention", "+1.8% revenue"])
expStatusCol = Col("Status", ["Running", "Running"])

patchNotes = Card([patchHeading, patchForm], "sunk")
patchHeading = Heading("Draft Patch Notes", "h3")
patchForm = Form("patch-notes", patchButtons, [patchTitleField, patchBodyField])
patchTitleField = FormControl("Title", patchTitleInput)
patchTitleInput = Input("title", "e.g. v2.5.1 Hotfix")
patchBodyField = FormControl("Notes", patchBodyArea)
patchBodyArea = TextArea("body", "Summarize changes, fixes, and balance updates...", 6)
patchButtons = Buttons([saveDraftBtn, publishBtn])
saveDraftBtn = Button("Save Draft", null, "secondary")
publishBtn = Button("Publish Notes", null, "primary")

hotfix = Card([hotfixHeading, hotfixBtn], "sunk")
hotfixHeading = Heading("Ship Hotfix", "h3")
hotfixBtn = Buttons([shipHotfixBtn])
shipHotfixBtn = Button("Deploy Hotfix to All Regions", null, "primary")

focusRegion = Card([focusHeading, focusForm], "sunk")
focusHeading = Heading("Focus on a Region", "h3")
focusForm = Form("focus-region", focusButtons, [regionSelectField])
regionSelectField = FormControl("Region", regionSelect)
regionSelect = Select("region", [regionUsEast, regionUsWest, regionEu, regionAp, regionSa, regionOc], "Choose a region to focus on")
regionUsEast = SelectItem("us-east", "US East")
regionUsWest = SelectItem("us-west", "US West")
regionEu = SelectItem("eu", "EU Central")
regionAp = SelectItem("ap", "AP Southeast")
regionSa = SelectItem("sa", "South America")
regionOc = SelectItem("oc", "Oceania")
focusButtons = Buttons([focusBtn])
focusBtn = Button("Focus on Region", null, "primary")