/* Phone layout - loaded last on every page, and only kicks in at phone
   widths, so the desktop layout in each page's own stylesheet is untouched.
   Shared header/footer/page-shell rules first, then each page's own fixes
   scoped by its body class (page-home, page-logs, ...). */

@media (max-width: 700px) {

    /* ---------- Page shell ----------
       Every page sizes header/main/footer as fixed % of the screen (and
       some pin header/footer with position: fixed), which on a phone
       leaves a sliver of content squeezed between two tall bars. Stack
       them instead: header and footer take what they need, main content
       gets the rest and scrolls on its own. */

    html, body {
        height: 100%;
        height: 100dvh;
    }

    body {
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    header {
        position: relative;
        flex: 0 0 auto;
        height: auto;
        min-height: 3.5rem;
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }

    .main-content {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    footer {
        position: relative;
        flex: 0 0 auto;
        height: auto;
        min-height: 3rem;
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }

    /* ---------- Header ---------- */

    .header-left {
        width: auto;
        flex: 0 0 auto;
        font-size: 0.7rem;
    }

    .header-left h3 {
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .header-right {
        width: auto;
        flex: 0 0 auto;
        height: auto;
    }

    /* Page titles are 2em of Audiowide - two or three lines on a phone */
    .title, #title, .header {
        font-size: 1rem;
        min-width: 0;
        max-width: none;
        flex: 1 1 auto;
    }

    .title h1, #title h1, .header h1 {
        font-size: clamp(1.05rem, 5.2vw, 1.5rem);
        line-height: 1.15;
        overflow-wrap: anywhere;
    }

    .profile-pic {
        width: 2.5rem;
        height: 2.5rem;
    }

    .burger {
        width: 2rem;
        height: 1.6rem;
    }

    .burger input:checked ~ span:nth-of-type(3) {
        top: 1.4rem;
    }

    /* ---------- Footer ---------- */

    .footer-left {
        width: auto;
        height: auto;
        flex: 0 0 auto;
    }

    .footer-button-box {
        flex: 1 1 auto;
        min-width: 0;
        height: auto;
        gap: 0.25rem 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .footer-right {
        width: auto;
        flex: 0 0 auto;
    }

    /* The crest in the corner is decoration - keep it, just small
       (logoBox() in utils.js sizes it inline, hence max-width) */
    .footer-right img,
    #logo-area img {
        max-width: 3rem;
        height: auto;
    }

    .bottom-button {
        padding: 0.4rem 0.6rem;
        font-size: 1rem;
    }

    .button-text {
        font-size: 0.95rem;
    }

    /* Modals across pages: use the screen, not a fixed desktop size */
    .modal-overlay .box,
    .modal .box,
    .modal .big-box {
        width: 94vw;
        max-width: 94vw;
        max-height: 88dvh;
        padding: 1rem;
    }

    img, canvas {
        max-width: 100%;
    }

    /* ---------- Home ---------- */

    .page-home .image {
        overflow: hidden;
        align-items: center;
    }

    .page-home .middle-logo {
        width: 95vw;
        height: auto;
        object-fit: contain;
    }

    .page-home .main-content {
        overflow: hidden;
    }

    .page-home .buttons {
        height: auto;
        gap: 1.25rem;
    }

    .page-home .btn {
        width: 70vw;
        max-width: 18rem;
        padding: 1.1rem;
    }

    /* ---------- Logs ---------- */

    .page-logs .main-content {
        margin-top: 0;
        height: auto;
        padding: 0.5rem 0.75rem 0;
        gap: 0.5rem;
    }

    /* Three tabs edge to edge */
    .page-logs .type-toggle {
        display: flex;
        width: 100%;
    }

    .page-logs .type-toggle button {
        flex: 1 1 0;
        padding: 0.55rem 0.4rem;
        font-size: 0.8rem;
    }

    .page-logs .logs-controls {
        gap: 0.5rem;
    }

    .page-logs .search-box,
    .page-logs .logs-select {
        height: 2.5rem;
        font-size: 1rem;
        padding: 0 0.75rem;
    }

    .page-logs .logs-select {
        max-width: 42%;
    }

    .page-logs .status-chips {
        flex-wrap: nowrap;
        gap: 0.3rem;
    }

    .page-logs .status-chips button {
        font-size: 0.68rem;
        padding: 0.3rem 0.55rem;
    }

    .page-logs .logs-div {
        padding: 0 0 1rem;
    }

    .page-logs .logs-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .page-logs .log-card:hover {
        transform: none;
    }

    /* ---------- Continue ---------- */

    .page-continue .main-content {
        padding: 0.25rem 0.75rem 0;
    }

    .page-continue .continue-div {
        padding: 0 0 1.5rem;
    }

    .page-continue .continue-grid {
        grid-template-columns: 1fr;
    }

    .page-continue .continue-card:hover {
        transform: none;
    }

    .page-continue .card-actions .btn {
        flex: 1 1 0;
    }

    /* The details panel becomes a sheet up from the bottom */
    .page-continue .panel-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .page-continue .continue-panel {
        max-height: 92dvh;
        border-radius: 1rem 1rem 0 0;
    }

    .page-continue .panel-head,
    .page-continue .panel-body,
    .page-continue .panel-actions {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    .page-continue .panel-stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-continue .stat {
        min-width: 0;
    }

    .page-continue .action-row .btn {
        flex: 1 1 calc(50% - 0.5rem);
    }

    .page-continue .panel-actions > .action-row > .btn.primary:first-child {
        flex-basis: 100%;
        margin-right: 0;
    }

    /* ---------- Results ---------- */

    .page-results .main-content {
        padding: 0.25rem 0.75rem 1.5rem;
    }

    .page-results .results-inner {
        gap: 1rem;
    }

    .page-results .panel {
        padding: 1rem 0.9rem;
    }

    .page-results .summary-stats {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .page-results .summary-date {
        font-size: 1rem;
    }

    .page-results .stat {
        min-width: 0;
        padding: 0.5rem 0.6rem;
    }

    .page-results .stat-value {
        font-size: 1.1rem;
    }

    .page-results .stat.text .stat-value {
        font-size: 0.85rem;
        line-height: 1.6;
    }

    .page-results .stat-label {
        font-size: 0.75rem;
    }

    .page-results #podium-section {
        padding: 1rem 0.6rem 0;
    }

    .page-results #podium {
        gap: 0.4rem;
    }

    .page-results .podium-avatar {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.1rem;
    }

    .page-results .step-1 .podium-avatar {
        width: 3.1rem;
        height: 3.1rem;
        font-size: 1.35rem;
    }

    .page-results .podium-name {
        font-size: 0.9rem;
    }

    .page-results .podium-score {
        font-size: 0.8rem;
    }

    .page-results .step-1 .podium-step { height: 5.5rem; }
    .page-results .step-2 .podium-step { height: 4rem; }
    .page-results .step-3 .podium-step { height: 3rem; }

    .page-results .podium-place {
        font-size: 1.1rem;
    }

    .page-results .results-columns {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .page-results #standings {
        font-size: 0.95rem;
    }

    .page-results #standings th,
    .page-results #standings td {
        padding-left: 0.4rem;
        padding-right: 0.4rem;
    }

    /* Speciality is in each player's breakdown - no room for it as a column */
    .page-results #standings .speciality {
        display: none;
    }

    .page-results .breakdown {
        padding: 0.75rem;
    }

    .page-results .breakdown-groups {
        grid-template-columns: 1fr;
    }

    .page-results .tl-game-head {
        gap: 0.6rem;
        padding: 0.6rem 0.65rem;
    }

    .page-results .tl-num {
        width: 1.8rem;
        height: 1.8rem;
        font-size: 0.85rem;
    }

    .page-results .tl-details {
        padding: 0 0.65rem 0.75rem;
    }

    .page-results .tl-event {
        margin-left: 0.6rem;
        padding-left: 0.8rem;
        font-size: 0.88rem;
    }

    .page-results .tl-event-tag {
        min-width: 3.6rem;
    }

    /* ---------- Stats ---------- */

    .page-stats .main-content {
        height: auto;
        padding: 0.5rem 0.75rem 0;
        gap: 0.6rem;
    }

    .page-stats .stats-toolbar {
        gap: 0.5rem;
    }

    .page-stats .type-toggle {
        display: flex;
        width: 100%;
    }

    .page-stats .type-toggle button {
        flex: 1 1 0;
        padding: 0.55rem 0.4rem;
        font-size: 0.85rem;
    }

    .page-stats .stats-view {
        overflow: visible;
        padding: 0 0 1.5rem;
        gap: 1rem;
    }

    .page-stats .panel {
        padding: 0.9rem 0.85rem;
    }

    .page-stats .columns {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .page-stats .tiles {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .page-stats .tile {
        padding: 0.7rem 0.8rem;
    }

    .page-stats .tile-value {
        font-size: 1.35rem;
    }

    .page-stats .view-head h1 {
        font-size: 1.5rem;
    }

    .page-stats .hbar-row {
        grid-template-columns: minmax(5.5rem, 8rem) 1fr;
    }

    /* Tables become a card per row: name on top, the rest as label/value
       pairs. The header row stays as a swipeable strip of sort buttons. */
    .page-stats .stats-table,
    .page-stats .stats-table thead,
    .page-stats .stats-table tbody {
        display: block;
        width: 100%;
    }

    .page-stats .stats-table thead tr {
        display: flex;
        gap: 0.35rem;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .page-stats .stats-table thead th {
        flex: 0 0 auto;
        padding: 0.3rem 0.65rem;
        border: 1px solid rgba(159, 223, 232, 0.35);
        border-radius: 999px;
        font-size: 0.72rem;
    }

    .page-stats .stats-table thead th:not([aria-sort='none']) {
        color: #04161a;
        background: #33eaff;
        border-color: transparent;
    }

    .page-stats .stats-table tbody tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.25rem 1rem;
        padding: 0.7rem 0.25rem;
    }

    .page-stats .stats-table td {
        display: flex;
        justify-content: space-between;
        gap: 0.5rem;
        padding: 0;
        white-space: normal;
        text-align: right;
        font-size: 0.95rem;
    }

    .page-stats .stats-table td::before {
        content: attr(data-label);
        color: #9fdfe8;
        text-align: left;
    }

    .page-stats .stats-table td:first-child {
        grid-column: 1 / -1;
        font-size: 1.05rem;
    }

    .page-stats .stats-table td:first-child::before {
        content: none;
    }

    .page-stats .stats-table td.text:not(:first-child) {
        grid-column: 1 / -1;
    }

    /* ---------- Create: the book becomes a single page ---------- */

    .page-create .main-content {
        padding: 0.25rem 0.6rem 0.9rem;
    }

    .page-create .book {
        max-height: none;
        overflow: hidden;
        border-radius: 0.8rem;
    }

    .page-create .book::before,
    .page-create .page-left,
    .page-create .spine {
        display: none;
    }

    .page-create .page-right,
    .page-create .leaf-front {
        border-radius: 0.8rem;
        box-shadow: 0 0 0 1px rgba(51, 234, 255, 0.3);
    }

    .page-create .page-body {
        padding: 1rem 0.9rem 0.8rem;
        gap: 0.9rem;
    }

    .page-create .page-foot {
        padding: 0.7rem 0.9rem;
    }

    .page-create .page-number {
        display: none;
    }

    /* closed: the cover is the whole (single) page */
    .page-create .book.closed:not(.opening) {
        transform: none;
    }

    .page-create .cover {
        inset: 0;
    }

    .page-create .cover-face {
        border-radius: 0.8rem;
    }

    .page-create .book.small {
        height: min(34rem, 82vh);
    }

    .page-create .mini-steps {
        display: flex;
        gap: 0.4rem;
        margin-top: 0.4rem;
    }

    .page-create .mini-step {
        width: 1.6rem;
        height: 0.4rem;
        padding: 0;
        border: none;
        border-radius: 999px;
        background: rgba(159, 223, 232, 0.25);
    }

    .page-create .mini-step.state-done,
    .page-create .mini-step.state-skip {
        background: rgba(74, 222, 128, 0.7);
    }

    .page-create .mini-step.current {
        width: 2.6rem;
        background: #33eaff;
    }

    .page-create .player-grid {
        grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
        gap: 0.5rem;
    }

    .page-create .game-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-create .review {
        grid-template-columns: 1fr;
    }

    .page-create .segmented {
        align-self: stretch;
        justify-content: space-between;
    }

    .page-create .segment {
        flex: 1 1 0;
        min-width: 0;
    }

    .page-create .notice.error {
        margin: 0 0.9rem;
    }

    .page-create .page-foot .btn {
        font-size: 0.85rem;
        padding: 0.6rem 0.9rem;
    }

    /* ---------- Quick Play (create.css) ---------- */

    .page-quickplay #quick-play-content #player-boxes {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
        gap: 0.75rem;
        width: 100%;
        padding: 0.5rem;
    }

    /* Quick Play's players sit inside a padded box - a bit narrower */
    .page-quickplay #quick-play-content #player-boxes {
        grid-template-columns: repeat(auto-fill, minmax(5.25rem, 1fr));
    }

    .page-quickplay #quick-play-content .player-box {
        min-width: 0;
        width: 100%;
        gap: 0.5rem;
        padding: 0.6rem 0.4rem;
    }

    .page-quickplay #quick-play-content .player-box h4 {
        font-size: 0.85rem;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .page-quickplay #quick-play-content .player-box-pfp {
        width: 2.75rem;
        height: 2.75rem;
    }

    .page-quickplay .player-box:hover {
        transform: none;
    }

    .page-quickplay .box {
        width: 100%;
        padding: 1rem 0.75rem;
        gap: 1rem;
    }

    .page-quickplay #quick-play-content {
        padding: 0.5rem 0.75rem 1.5rem;
        gap: 1rem;
    }

    .page-quickplay .footer-left {
        order: 2;
    }

    .page-quickplay #quick-play-summary {
        font-size: 1rem;
    }

    .page-quickplay #quickStartBtn {
        background: #33eaff;
        box-shadow: 0 0 12px #33eaffaa;
        padding: 0.5rem 1.25rem;
    }

    .page-quickplay #quickStartBtn .button-text {
        color: #000000;
        text-shadow: none;
    }

    /* ---------- Game ---------- */

    /* Live scoreboard: smaller chips, scrolls sideways */
    .page-game .scoreboard {
        top: 84px;
        width: calc(100vw - 1rem);
        padding: 0.3rem;
    }

    .page-game .score-chip {
        gap: 0.3rem;
        padding: 0.15rem 0.55rem 0.15rem 0.25rem;
    }

    .page-game .score-place,
    .page-game .score-legend {
        display: none;
    }

    .page-game .score-dot {
        width: 1.35rem;
        height: 1.35rem;
        font-size: 0.65rem;
    }

    .page-game .score-name {
        font-size: 0.85rem;
    }

    .page-game .score-nums {
        font-size: 0.78rem;
    }

    body.page-game.has-scoreboard .main-content {
        margin-top: 140px;
    }

    .page-game .title-card {
        padding: 1.1rem 1rem 1rem;
    }

    .page-game .mode-switch {
        margin: 0.75rem auto;
    }

    .page-game .callouts {
        top: 120px;
    }

    .page-game .callout {
        font-size: 1rem;
        border-radius: 1rem;
    }

    /* A game's results: Game Results above Overall Results, full width,
       instead of two narrow columns side by side */
    .page-game .curr_game_results_div {
        flex-direction: column;
        height: auto;
        gap: 1rem;
    }

    .page-game .results_section {
        width: 100%;
        height: auto;
    }

    .page-game .results_section h2 {
        font-size: 1.3rem;
        text-align: center;
    }

    .page-game #results_line {
        width: 100%;
        height: 0;
    }

    .page-game .curr_game_results {
        width: 100%;
        padding: 0.5rem 0.25rem;
        overflow-x: visible;
    }

    .page-game .curr_game_box {
        padding: 0.9rem;
        gap: 0.5rem;
        text-wrap: wrap;
    }

    /* the wheel already fills the width - glow, don't grow */
    body.page-game.wheel-spinning #wheelCanvas {
        transform: none;
    }

    .page-game .mode-option {
        min-width: 0;
        padding: 0.5rem 0.4rem;
        font-size: 0.95rem;
    }

    .page-game .header-left {
        font-size: 0.65rem;
    }

    /* Game/cone/player wheels: the canvases are a fixed 500px, and SPIN is
       sized as a % of the (now much taller than wide) wheel area */
    .page-game #wheelCanvas,
    .page-game #wheelCanvas2 {
        width: min(92vw, 500px);
        height: auto;
    }

    .page-game .spinner {
        width: 3.5rem;
        height: 3.5rem;
        margin-left: -1.75rem;
        margin-top: -1.75rem;
        font-size: 0.85rem;
    }

    .page-game #welcome h1 {
        font-size: 1.6rem;
    }

    .page-game #welcome h3 {
        font-size: 1rem;
    }

    .page-game #top-title,
    .page-game #top-title h1 {
        font-size: 1.6rem;
    }

    .page-game #top-title h2 {
        font-size: 1.2rem;
    }

    /* Vote screen: player column + game grid side by side -> players as a
       swipeable row on top, games underneath */
    .page-game #voting_game {
        flex-direction: column;
        overflow-y: auto;
        gap: 0.75rem;
        padding: 0.5rem 0;
    }

    .page-game #voting {
        flex: 0 0 auto;
        flex-direction: row;
        width: 100%;
        max-height: none;
        overflow-x: auto;
        overflow-y: visible;
    }

    .page-game #voting > * {
        flex: 0 0 auto;
        width: 13rem;
    }

    .page-game #voteGameGrid {
        padding: 0 0.5rem;
    }

    /* Quick Play setup footer: summary + Start, no room for the crest */
    .page-quickplay .footer-right {
        display: none !important; /* logoBox() sets display inline */
    }

    /* ---------- Sign in / profile modal (user.css, every page) ----------
       Inputs are a fixed 30rem and the profile/avatar views are
       side-by-side columns - none of it fits a phone. */

    #user-profile-box {
        width: 94vw;
        height: auto;
        max-height: 90dvh;
        padding: 1rem 0.9rem 1.25rem;
        gap: 0.75rem;
        overflow-y: auto;
    }

    .user-profile-corner-div {
        top: 0;
        right: 0;
        margin: 0;
    }

    #user-profile-title {
        font-size: 1.5rem;
    }

    #user-profile-div {
        height: auto;
        gap: 1rem;
        justify-content: flex-start;
    }

    .form_container {
        width: 100%;
        height: auto;
        gap: 2rem;
    }

    .form {
        width: 100%;
        gap: 0.75rem;
    }

    .form h2, .form h3 {
        font-size: 1rem;
    }

    .user-input {
        width: 100%;
        max-width: 100%;
        padding: 0.85rem 1.1rem;
        font-size: 1rem;
    }

    .user_input_div {
        width: 100%;
    }

    .password_eye,
    .password_eye:hover,
    .password_eye:active {
        width: 1.6rem;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
    }

    #password_area {
        width: 100%;
        flex-direction: column;
        gap: 0.75rem;
    }

    .user-button:hover {
        transform: none;
    }

    /* Profile: avatar on top, details underneath */
    .user_middle_div {
        flex-direction: column;
        height: auto;
        gap: 1rem;
    }

    .user_avatar_div,
    .user_div {
        width: 100%;
        height: auto;
    }

    #user_avatar {
        width: 8rem;
    }

    #avatar_btns_div {
        justify-content: center;
        gap: 0.75rem;
        padding: 0.5rem 0;
    }

    #avatar_btns_div > * {
        width: auto;
        min-width: 7rem;
        padding: 0.6rem 1rem;
    }

    #user_form {
        padding: 0;
    }

    .user_input_section {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        width: 100%;
    }

    #username-btn, #password-btn {
        width: 100%;
        height: auto;
        padding: 0.7rem 1rem;
    }

    #user_change_password {
        width: 100%;
    }

    /* Swap avatar */
    #swap_avatar_div {
        height: auto;
        padding: 0;
    }

    #avatar_controls {
        width: 100%;
        gap: 1rem;
        flex-wrap: wrap;
    }

    #user_avatar_options {
        height: auto;
        gap: 1rem;
        padding: 0.75rem 0;
    }

    .user_avatar_option {
        width: 5.5rem;
        height: 5.5rem;
    }

    .user_avatar_option_selected {
        border-width: 0.3rem;
    }

    /* Edit avatar: preview + options stack */
    #avatar_div {
        flex-direction: column;
        height: auto;
        gap: 1rem;
        padding: 0;
    }

    #avatar_preview_and_base {
        width: 100%;
        height: auto;
        gap: 1rem;
    }

    #avatar_preview {
        width: 9rem;
        height: 9rem;
    }

    .avatar_options,
    #avatar_base {
        height: auto;
        gap: 1.25rem;
        padding: 0.5rem 0;
        overflow: visible;
    }

    .avatar_option {
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .avatar_option_text {
        width: auto;
        flex: 1 1 auto;
    }

    /* ---------- Game page modals (Intrude/Abandon/Skip/Cones/Change Games) ---------- */

    /* One unwrapped row of player buttons: centred overflow cut off both
       ends, and the left end couldn't be scrolled to at all */
    .page-game .middle-players {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .page-game .middle-title {
        font-size: 1.4rem;
        padding: 0 1.5rem;
    }

    .page-game #break-cone-players,
    .page-game #victory-cone-players {
        height: auto;
        gap: 1rem;
        padding: 1rem 0.5rem;
    }

    .page-game .middle-close-div {
        position: relative;
        top: 0;
        right: 0;
        margin: 0 0 -2rem;
    }

    /* ---------- Add a New Game (Create's Games step + game page's Change Games) ---------- */

    #addGameModal-box {
        width: 94vw;
        max-height: 90dvh;
        padding: 1rem;
        gap: 1rem;
    }

    #addGameModal-box .middle-title {
        font-size: 1.5rem;
    }

    /* label/field pairs stack instead of a 1fr/2fr grid */
    #add-game-form {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    #add-game-form label:not(:first-child) {
        margin-top: 0.6rem;
    }

    /* user.css pins this note to column 2, which would quietly add a
       second column straight back */
    #add-game-results-type-note {
        grid-column: 1;
        margin: 0;
    }

    #add-game-buttons {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }

    /* ---------- In-game screens ---------- */

    /* Tournament: bracket list (30%) + bracket (70%) side by side -> the
       match being played on top, the whole bracket underneath, scrollable */
    .page-game #tournament_section {
        flex-direction: column;
        gap: 1rem;
    }

    .page-game #left_tournament {
        width: 100%;
        gap: 1rem;
    }

    .page-game #right_tournament {
        width: 100%;
        height: 50dvh;
    }

    /* Counter games: 12%-wide score boxes chop the names */
    .page-game .counter-container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .page-game .counter-scorebox {
        width: calc(50% - 0.5rem);
        margin: 0;
        padding: 0.5rem;
    }

    .page-game .counter-scorebox h4 {
        font-size: 1rem;
        overflow-wrap: anywhere;
    }

    /* Pre-game cone / refresh-games prompts: half-width with a 14rem gap */
    .page-game #pre-game,
    .page-game #refresh-games {
        width: 92%;
        gap: 1.5rem;
    }

    .page-game #pre-game-buttons,
    .page-game #refresh-buttons {
        width: 70%;
    }

    .page-game #pre-game-result,
    .page-game #refresh-result {
        margin-top: 2rem;
        padding: 0 1rem;
        text-align: center;
    }

    .page-game #neighButtons1,
    .page-game #neighButtons2,
    .page-game #neighButtons3 {
        gap: 2rem;
    }

    .page-game #askNeigh-section h2 {
        font-size: 1.3rem;
        padding: 0 1rem;
        text-align: center;
    }

    .page-game #coin_box {
        flex-wrap: wrap;
        gap: 1rem;
        height: auto;
    }

    .page-game #four20game_players {
        gap: 0.75rem;
    }

    .page-game #four20game_section h1 {
        font-size: 1.5rem;
        text-align: center;
    }
}
