/* ZimCity: the map owns the screen. The strip above it (demand, money, then the date and people, quieter), the status line, the map, then the held tool's line and the tray at the thumb. Zone colours are materials (the original's green, blue and yellow, pulled toward neutral); everything else is games.css tokens. */ :root { --cy-res: #3f9a52; --cy-com: #3b6fc4; --cy-ind: #c9961a; --cy-ground: #cdbf98; } @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --cy-res: #5cb46d; --cy-com: #6d93e0; --cy-ind: #e0b043; --cy-ground: #4d4738; } } :root[data-theme="dark"] { --cy-res: #5cb46d; --cy-com: #6d93e0; --cy-ind: #e0b043; --cy-ground: #4d4738; } body.cy-page { display: flex; flex-direction: column; height: 100%; height: 100dvh; overflow: hidden; padding-left: var(--safe-l); padding-right: var(--safe-r); box-sizing: border-box; } .cy-page .gm-about { display: none; } .cy-main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; width: 100%; max-width: var(--column); margin: 0 auto; } /* The strip: demand leads (it decides the next move), the money second, the date and population quiet at the right. */ .cy-strip { flex: none; display: flex; align-items: center; gap: var(--sp-3); min-height: 40px; padding: var(--sp-1) var(--gutter); } .cy-rci { flex: none; display: flex; align-items: stretch; gap: 3px; height: 28px; padding: 0 2px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); } /* Each bar grows up from the middle line for demand and down for a surplus. */ .cy-dem { position: relative; width: 8px; } .cy-dem::before { content: ""; position: absolute; left: -2px; right: -2px; top: 50%; height: 1px; background: var(--line-strong); } .cy-dem i { position: absolute; left: 0; right: 0; bottom: 50%; border-radius: 2px; height: max(2px, calc(var(--dem, 0) * 50%)); } .cy-dem.cy-neg i { bottom: auto; top: 50%; opacity: 0.55; } .cy-dem[data-k="residential"] i { background: var(--cy-res); } .cy-dem[data-k="commercial"] i { background: var(--cy-com); } .cy-dem[data-k="industrial"] i { background: var(--cy-ind); } .cy-funds { flex: none; font: 650 var(--fs-title)/1 var(--font); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; } .cy-when { flex: 1 1 auto; min-width: 0; text-align: end; font-size: var(--fs-small); color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; } .cy-funds.cy-low { color: var(--bad); } /* A scenario's goal: always there, and wrapping onto a second line before it would be cut (the goal first, then where the city stands). */ .cy-goal { flex: none; margin: 0; padding: 0 var(--gutter) var(--sp-1); display: flex; flex-wrap: wrap; column-gap: var(--sp-2); font-size: var(--fs-small); line-height: 1.35; color: var(--ink2); } .cy-goal[hidden] { display: none; } .cy-goal b { color: var(--ink); font-weight: 650; } .cy-goal span { font-variant-numeric: tabular-nums; } .cy-msg { flex: none; min-height: 1.45em; padding: 0 var(--gutter); max-width: 100%; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; line-height: 1.35; } /* two lines before it is cut: a long translation or a citizen's quote is read whole */ /* The map: everything left between the strip and the tray. */ .cy-stage { position: relative; flex: 1 1 auto; min-height: 120px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--cy-ground); } /* the land's own colour until the first picture is drawn, so the map is never a blank sheet */ #cy-map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; } #cy-map:focus-visible { outline-offset: -3px; } /* The held tool's line and the tray, clear of the home indicator. */ .cy-foot { flex: none; padding: var(--sp-2) var(--gutter) calc(var(--sp-2) + var(--safe-b)); display: flex; flex-direction: column; gap: var(--sp-2); } .cy-held { margin: 0; min-height: 1.4em; font-size: var(--fs-small); color: var(--ink2); text-align: center; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; font-variant-numeric: tabular-nums; } .cy-held.cy-bad { color: var(--bad); } .cy-tray { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--sp-1); } /* Seven tools must each stay a thumb wide (--target): a narrow phone gives the tray the page's edges, and a very narrow one two rows. */ @media (max-width: 380px) { .cy-foot { padding-inline: var(--sp-2); } .cy-tray { gap: 2px; } } @media (max-width: 340px) { .cy-tray { grid-template-columns: repeat(auto-fit, minmax(var(--target), 1fr)); } } .cy-tool { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; min-height: 48px; padding: 4px 2px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; touch-action: manipulation; } @media (hover: hover) { .cy-tool:hover, .cy-more-tool:hover { border-color: var(--accent); } } .cy-tool[aria-pressed="true"] { background: var(--accent-glow); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); } .cy-icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; } .cy-icon-more { stroke-width: 3.2; } .cy-icon-residential { color: var(--cy-res); } .cy-icon-commercial { color: var(--cy-com); } .cy-icon-industrial { color: var(--cy-ind); } /* A phone shows the tray as icons (the held line names the tool and its cost); wider screens add the word under each. */ .cy-tool-l { display: none; font-size: var(--fs-small); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; } @media (min-width: 560px) { .cy-tool-l { display: block; } .cy-tool { min-height: 56px; } } /* The More sheet: the rest of the tools, three to a row. */ .cy-more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); } .cy-more-tool { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 76px; padding: var(--sp-2) var(--sp-1); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; text-align: center; } .cy-more-tool[aria-pressed="true"] { background: var(--accent-glow); border-color: var(--accent); } .cy-more-l { font-size: var(--fs-small); line-height: 1.2; } .cy-more-c { font-size: var(--fs-small); color: var(--ink2); font-variant-numeric: tabular-nums; } /* The budget's steppers: − value + in one 44 px control. */ .cy-stepper { display: inline-flex; align-items: center; } .cy-stepper .ar-btn { min-width: var(--target); padding: 0; font-size: var(--fs-title); } .cy-step-v { min-width: 7.5em; text-align: center; font-size: var(--fs-small); font-variant-numeric: tabular-nums; } .cy-costs { color: var(--ink2); } .cy-sub { margin: var(--sp-3) 0 var(--sp-1); font-size: var(--fs-body); font-weight: 650; } .cy-credit p { margin: 0 0 var(--sp-2); } /* Landscape on a phone: the map takes the whole height under the bar, and what the strip, the message and the tray say stands in a column beside it (a bar, a strip and a line above the map left it 270 px of 390). */ @media (orientation: landscape) and (max-height: 520px) { .cy-main { display: grid; grid-template-columns: 1fr 184px; grid-template-rows: auto auto auto 1fr; } .cy-stage { grid-column: 1; grid-row: 1 / -1; } .cy-strip, .cy-goal, .cy-msg, .cy-foot { grid-column: 2; } .cy-strip { flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); padding-inline: 10px; } .cy-when { flex: 1 0 100%; text-align: start; } .cy-goal { padding-inline: 10px; } .cy-msg { padding-inline: 10px; text-align: start; font-size: var(--fs-small); -webkit-line-clamp: 4; line-clamp: 4; } .cy-foot { grid-row: 4; min-height: 0; overflow-y: auto; justify-content: flex-end; padding-inline: 10px; } /* Icons only, three across: seven tools in three rows fit the height a phone on its side leaves. */ .cy-tray { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cy-tool { min-height: var(--target); } .cy-tool .cy-tool-l { display: none; } } /* The news card: an article's lead over the top of the map when something happens that the library knows about. */ .cy-news { position: absolute; z-index: 1; top: var(--sp-2); left: var(--sp-2); right: var(--sp-2); max-width: 520px; max-height: calc(50% - var(--sp-4)); overflow: hidden; margin: 0 auto; display: flex; align-items: flex-start; gap: var(--sp-1); padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface2); box-shadow: var(--shadow-popup); } .cy-news[hidden] { display: none; } /* never over the middle of the map: on a short stage (a phone on its side) the picture goes and the lead keeps one line */ @media (max-height: 520px) { .cy-news { right: auto; max-width: min(360px, 60%); } .cy-news-img { display: none; } .cy-news-text span { -webkit-line-clamp: 1; } } .cy-news-link { flex: 1 1 auto; min-width: 0; display: flex; gap: var(--sp-3); color: var(--ink); text-decoration: none; } .cy-news-img { flex: none; width: 56px; height: 56px; border-radius: var(--r-chip); object-fit: cover; background: var(--surface); } .cy-news-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; } .cy-news-text small { font-size: var(--fs-small); color: var(--accent); } .cy-news-text b { font-size: var(--fs-body); font-weight: 650; } .cy-news-text span { font-size: var(--fs-small); color: var(--ink2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } .cy-news-close { flex: none; width: var(--target); height: var(--target); margin: calc(var(--sp-2) * -1) calc(var(--sp-2) * -1) 0 0; border: 0; background: none; color: var(--ink2); font-size: 22px; cursor: pointer; } @media (prefers-reduced-motion: no-preference) { .cy-news:not([hidden]) { animation: cy-news-in 200ms ease-out; } } @keyframes cy-news-in { from { transform: translateY(-8px); } } .cy-read { margin-top: var(--sp-2); } /* Following a citizen: a card along the bottom of the map, who and where, their line, Keep in view and close. */ .cy-follow-card { position: absolute; z-index: 1; bottom: var(--sp-2); left: var(--sp-2); right: var(--sp-2); max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface2); box-shadow: var(--shadow-popup); } .cy-follow-card[hidden] { display: none; } .cy-fw-who { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; } .cy-fw-who b { font-size: var(--fs-body); font-weight: 650; } .cy-fw-who small { font-size: var(--fs-small); color: var(--accent); } .cy-fw-who q, .cy-fw-q { font-size: var(--fs-small); color: var(--ink2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } .cy-fw-view { flex: none; } .cy-fw-row { flex-wrap: nowrap; align-items: center; gap: var(--sp-3); } .cy-fw-row .cy-kept-what { flex: 1 1 auto; } .cy-fw-row .ar-btn { flex: none; } .cy-follow-card .cy-news-close { margin: 0 calc(var(--sp-2) * -1) 0 0; } /* While you were away: the catching up, then the news. */ .cy-aw-bar { width: 100%; height: 6px; accent-color: var(--accent); } .cy-aw-news { margin: 0 0 var(--sp-2); padding-inline-start: 1.2em; } .cy-aw-news li { margin: 2px 0; } .cy-aw-voice { font-style: italic; } /* Kept cities: when and how big on the left, Open and Delete on the right. */ .cy-keep { width: 100%; margin-bottom: var(--sp-2); } .cy-kept { align-items: center; } .cy-kept-what { display: flex; flex-direction: column; min-width: 0; } .cy-kept-name { font: inherit; font-weight: 650; color: inherit; background: none; border: 0; border-bottom: 1px dashed var(--ink3); padding: 2px 0; min-width: 0; width: 100%; border-radius: 0; } .cy-kept-name:focus { outline: none; border-bottom: 1px solid var(--accent); } .cy-kept-what small { font-size: var(--fs-small); color: var(--ink2); } .cy-kept-acts { display: flex; gap: var(--sp-2); flex: none; } /* Scenarios: each a row (name, story, links; Play), then the ready-made cities as a grid of buttons. */ /* A scenario row: the whole row plays it (a chevron says so); its links sit under it, outside the button. */ .cy-sc { padding: var(--sp-1) 0; } .cy-sc + .cy-sc { border-top: 1px solid var(--line); } .cy-sc-go { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: var(--target); padding: var(--sp-1) 0; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; } .cy-sc-go .cy-kept-what { flex: 1 1 auto; } .cy-sc-chev { flex: none; width: 8px; height: 8px; border-top: 2px solid var(--ink2); border-right: 2px solid var(--ink2); transform: rotate(45deg); margin-inline-end: 4px; } [dir="rtl"] .cy-sc-chev { transform: rotate(-135deg); } .cy-sc-links { display: block; margin: -2px 0 var(--sp-1); font-size: var(--fs-small); } .cy-maps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); } .cy-maps .ar-btn { min-height: var(--target); padding: 0 var(--sp-1); font-size: var(--fs-small); } .cy-sc-note { font-size: var(--fs-small); color: var(--ink2); margin-top: var(--sp-3); } /* How to play: the gestures and the sizes, as pictures with a word or a number each */ .cy-how { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; } .cy-how-row { display: flex; align-items: center; gap: 12px; margin: 0; } .cy-how-row .cy-icon { flex: none; } .cy-how-sizes { gap: 20px; flex-wrap: wrap; } .cy-how-size { display: inline-flex; align-items: center; gap: 4px; } .cy-how-size b { margin-inline-start: 4px; font-variant-numeric: tabular-nums; } /* The bar's Undo and Pause are pictures (their words stay for a screen reader): a translated word beside Menu squeezed the title to "Zi..." in Spanish and out of sight in German and Russian. */ .cy-page #cy-undo, .cy-page #cy-pause { position: relative; width: 44px; padding: 0; font-size: 0; } .cy-page #cy-undo::before, .cy-page #cy-pause::before { content: ""; position: absolute; inset: 0; margin: auto; width: 22px; height: 22px; background: currentColor; -webkit-mask: var(--cy-glyph) center / contain no-repeat; mask: var(--cy-glyph) center / contain no-repeat; } .cy-page #cy-undo { --cy-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 14L4 9l5-5M4 9h10.5a5.5 5.5 0 0 1 0 11H11'/%3E%3C/svg%3E"); } .cy-page #cy-pause { --cy-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round'%3E%3Cpath d='M8 5v14M16 5v14'/%3E%3C/svg%3E"); } .cy-page #cy-pause[data-t="play.resume"] { --cy-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 4l13 8-13 8z' fill='black'/%3E%3C/svg%3E"); }