:root {
    color-scheme: light;
    --page: #edf3f0;
    --surface: #ffffff;
    --surface-soft: #f5f8f7;
    --surface-muted: #e8efec;
    --ink: #17241f;
    --ink-soft: #52635c;
    --ink-faint: #72817b;
    --line: #d7e1dd;
    --line-strong: #bdccc6;
    --navy: #102720;
    --navy-2: #16362c;
    --navy-3: #1d4437;
    --green: #16875f;
    --green-strong: #087049;
    --green-deep: #07543a;
    --green-soft: #e4f5ed;
    --green-pale: #f1faf6;
    --yellow: #c88912;
    --yellow-strong: #94600a;
    --yellow-soft: #fff4d6;
    --red: #d14949;
    --red-strong: #aa2c33;
    --red-soft: #fde9e8;
    --blue: #3275c7;
    --blue-soft: #e9f2ff;
    --shadow-sm: 0 5px 16px rgb(13 47 35 / 7%);
    --shadow-md: 0 16px 40px rgb(12 38 29 / 12%);
    --shadow-lg: 0 30px 80px rgb(4 25 18 / 24%);
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;
    --header-height: 64px;
    --status-ribbon-height: 80px;
    --ease: cubic-bezier(0.2, 0.75, 0.25, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--page);
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 0%, rgb(22 135 95 / 10%), transparent 28rem),
        linear-gradient(180deg, #f2f7f5 0%, var(--page) 28rem);
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN",
        "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

small {
    font-size: max(13px, 1em);
}

button,
input,
a {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    color: inherit;
}

a {
    color: inherit;
}

button:not(:disabled),
a[href],
label {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
}

img,
svg {
    display: block;
    max-width: 100%;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

[hidden] {
    display: none !important;
}

::selection {
    color: #fff;
    background: var(--green-strong);
}

:focus-visible {
    outline: 3px solid #75b9ff;
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 12px;
    z-index: 10000;
    padding: 10px 16px;
    color: #fff;
    background: var(--navy);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    font-weight: 800;
    text-decoration: none;
    transform: translateY(-160%);
    transition: transform 0.2s var(--ease);
}

.skip-link:focus {
    transform: translateY(0);
}

.screen-reader-live {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* App frame */

.app-shell {
    min-height: 100vh;
    padding-bottom: 40px;
}

.site-footer {
    padding: 22px clamp(16px, 2.7vw, 44px) 4px;
    text-align: center;
}

.site-footer a {
    text-decoration: none;
}

.site-footer p {
    margin: 0;
    color: var(--ink-faint);
    font-size: 12px;
    font-weight: 650;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
    padding: 9px clamp(18px, 3vw, 52px);
    color: #fff;
    background: linear-gradient(110deg, rgb(255 255 255 / 4%), transparent 35%), var(--navy);
    border-bottom: 1px solid rgb(255 255 255 / 8%);
    box-shadow: 0 6px 22px rgb(4 25 18 / 18%);
}

.brand-lockup {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 13px;
}

.brand-mark {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 4px 10px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 18px rgb(0 0 0 / 20%);
}

.brand-mark img {
    display: block;
    height: 100%;
    width: auto;
}

.brand-name {
    margin: 0 0 1px;
    color: #8cdec0;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.18em;
    line-height: 1.2;
}

.brand-lockup h1 {
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    font-size: clamp(17px, 2vw, 23px);
    font-weight: 850;
    letter-spacing: 0.01em;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
}

.safe-demo-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    color: #c8f3e2;
    background: rgb(57 176 128 / 12%);
    border: 1px solid rgb(126 229 187 / 22%);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.safe-demo-label span {
    color: #58d9a5;
    font-size: 13px;
    filter: drop-shadow(0 0 5px #58d9a5);
}

.quiet-button {
    min-height: 33px;
    padding: 6px 11px;
    color: #dfeae6;
    background: rgb(255 255 255 / 7%);
    border: 1px solid rgb(255 255 255 / 15%);
    border-radius: 9px;
    font-size: 13px;
    font-weight: 750;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease;
}

.quiet-button:not(:disabled):hover,
.quiet-button[aria-pressed="true"] {
    color: #fff;
    background: rgb(50 178 128 / 20%);
    border-color: rgb(116 222 179 / 38%);
}

.quiet-button:disabled {
    color: rgb(223 234 230 / 38%);
    background: transparent;
    border-color: rgb(255 255 255 / 8%);
}

/* Status ribbon */

.game-chrome {
    position: sticky;
    top: var(--header-height);
    z-index: 70;
    background: rgb(237 243 240 / 95%);
    border-bottom: 1px solid #d4dfdb;
    box-shadow: 0 5px 13px rgb(9 42 30 / 8%);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.status-ribbon {
    position: static;
    display: grid;
    grid-template-columns: minmax(155px, 1.05fr) minmax(220px, 1.5fr) repeat(
            4,
            minmax(98px, 0.62fr)
        );
    height: var(--status-ribbon-height);
    max-width: 1740px;
    margin: 0 auto;
    padding: 6px clamp(16px, 2.7vw, 44px);
    gap: 10px;
}

.status-card,
.metric-card {
    position: relative;
    min-height: 68px;
    padding: 7px 14px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.status-card::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 5px;
    content: "";
    background: var(--tone, var(--green));
}

.status-label {
    display: block;
    margin-bottom: 4px;
    color: var(--ink-faint);
    font-size: 13px;
    font-weight: 850;
    letter-spacing: 0.05em;
    line-height: 1.35;
}

.score-card {
    display: grid;
    grid-template-columns: auto auto;
    align-content: center;
    column-gap: 10px;
    padding-left: 18px;
}

.score-card .status-label {
    grid-column: 1 / -1;
}

.score-card strong {
    color: var(--tone-dark, var(--green-strong));
    font-size: clamp(28px, 3vw, 40px);
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    letter-spacing: -0.045em;
    line-height: 0.95;
}

.score-card strong small,
.metric-card strong small {
    margin-left: 2px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
}

.status-caption {
    align-self: end;
    margin-bottom: 2px;
    color: var(--tone-dark, var(--green-strong));
    font-size: 13px;
    font-weight: 850;
    white-space: nowrap;
}

.health-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 18px;
}

.health-card strong {
    display: block;
    color: var(--tone-dark, var(--red-strong));
    font-size: 17px;
    font-weight: 900;
    line-height: 1.35;
}

.health-card strong span {
    display: inline-grid;
    width: 23px;
    height: 23px;
    margin-right: 5px;
    place-items: center;
    color: #fff;
    background: var(--tone, var(--red));
    border-radius: 50%;
    font-size: 13px;
    vertical-align: 2px;
}

.meter {
    height: 5px;
    margin-top: 9px;
    overflow: hidden;
    background: var(--surface-muted);
    border-radius: 99px;
}

.meter span {
    display: block;
    width: 24%;
    height: 100%;
    background: var(--tone, var(--red));
    border-radius: inherit;
    box-shadow: 0 0 10px color-mix(in srgb, var(--tone, var(--red)) 55%, transparent);
    transition:
        width 0.5s var(--ease),
        background-color 0.25s ease;
}

.metric-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.metric-card strong {
    color: var(--ink);
    font-size: clamp(20px, 2.1vw, 28px);
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    letter-spacing: -0.035em;
    line-height: 1.15;
}

.attack-clock-card strong {
    color: var(--red-strong);
}

.tone-green {
    --tone: var(--green);
    --tone-dark: var(--green-strong);
    background: linear-gradient(120deg, var(--green-pale), #fff 68%);
    border-color: #c8e5d9;
}

.tone-yellow,
.tone-amber {
    --tone: var(--yellow);
    --tone-dark: var(--yellow-strong);
    background: linear-gradient(120deg, var(--yellow-soft), #fff 68%);
    border-color: #ecdba9;
}

.tone-red {
    --tone: var(--red);
    --tone-dark: var(--red-strong);
    background: linear-gradient(120deg, var(--red-soft), #fff 68%);
    border-color: #f0c7c5;
}

.tone-blue {
    --tone: var(--blue);
    --tone-dark: #1c60ad;
    background: linear-gradient(120deg, var(--blue-soft), #fff 68%);
    border-color: #cddff5;
}

/* Main panels */

.mobile-view-switch {
    display: none;
}

.game-layout {
    display: grid;
    grid-template-columns: minmax(580px, 1.12fr) minmax(410px, 0.88fr);
    align-items: start;
    max-width: 1740px;
    margin: 0 auto;
    padding: 0 clamp(16px, 2.7vw, 44px);
    gap: 14px;
}

.operations-panel,
.damage-panel {
    min-width: 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.operations-panel {
    padding: clamp(18px, 2vw, 28px);
    background: rgb(255 255 255 / 94%);
    border: 1px solid #d8e3df;
}

.damage-panel {
    position: sticky;
    top: calc(var(--header-height) + var(--status-ribbon-height) + 12px);
    max-height: calc(100vh - var(--header-height) - var(--status-ribbon-height) - 24px);
    padding: clamp(18px, 2vw, 25px);
    overflow: auto;
    color: #edf8f4;
    background:
        radial-gradient(circle at 105% -8%, rgb(66 193 145 / 18%), transparent 20rem),
        linear-gradient(145deg, var(--navy-2), #0c211a 78%);
    border: 1px solid rgb(255 255 255 / 8%);
    box-shadow: 0 18px 50px rgb(5 29 21 / 25%);
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 16px;
}

.eyebrow {
    margin: 0 0 2px;
    color: var(--green-strong);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.17em;
    line-height: 1.35;
}

.panel-heading h2 {
    margin: 0;
    font-size: clamp(22px, 2.2vw, 30px);
    font-weight: 900;
    letter-spacing: -0.025em;
    line-height: 1.25;
}

.damage-panel .eyebrow {
    color: #79d7b2;
}

.hint-button {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 12px;
    gap: 6px;
    color: #765106;
    background: var(--yellow-soft);
    border: 1px solid #ecd695;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 850;
    white-space: nowrap;
    transition:
        transform 0.18s var(--ease),
        box-shadow 0.18s ease,
        opacity 0.18s ease;
}

.hint-button small {
    color: #9a6b09;
    font-size: 13px;
}

.hint-button:not(:disabled):hover {
    box-shadow: 0 6px 16px rgb(148 96 10 / 15%);
    transform: translateY(-1px);
}

.hint-button:disabled {
    opacity: 0.48;
}

.objective-card {
    display: flex;
    align-items: flex-start;
    margin-bottom: 14px;
    padding: 12px 16px;
    gap: 13px;
    background: linear-gradient(105deg, var(--green-pale), #f8fbfa);
    border: 1px solid #cbe7da;
    border-radius: var(--radius);
}

.objective-icon {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    color: #fff;
    background: var(--green);
    border-radius: 10px;
    box-shadow: 0 5px 12px rgb(22 135 95 / 20%);
    font-size: 15px;
    font-weight: 900;
}

.objective-card > div:last-child {
    min-width: 0;
}

.objective-card span {
    display: block;
    margin-bottom: 1px;
    color: var(--green-strong);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.06em;
}

.objective-card strong {
    display: block;
    margin-bottom: 2px;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.45;
}

.objective-card p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 13px;
    line-height: 1.55;
}

.objective-card.warning,
.objective-card.is-warning {
    background: linear-gradient(105deg, var(--yellow-soft), #fffdf7);
    border-color: #ecd695;
}

.objective-card.warning .objective-icon,
.objective-card.is-warning .objective-icon {
    background: var(--yellow);
}

.objective-card.danger,
.objective-card.is-danger {
    background: linear-gradient(105deg, var(--red-soft), #fff8f7);
    border-color: #efc3c0;
}

.objective-card.danger .objective-icon,
.objective-card.is-danger .objective-icon {
    background: var(--red);
}

/* Recovery actions */

.action-instruction {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: start;
    margin: 0 0 10px;
    padding: 10px 12px;
    gap: 11px;
    background: var(--blue-soft);
    border: 1px solid #bfd6f2;
    border-left: 4px solid var(--blue);
    border-radius: 11px;
}

.action-instruction-icon {
    display: grid;
    min-height: 34px;
    place-items: center;
    color: #fff;
    background: var(--blue);
    border-radius: 8px;
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
}

.action-instruction strong {
    display: block;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.5;
}

.action-instruction p {
    margin: 3px 0 0;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.55;
}

.action-grid {
    display: grid;
    gap: 8px;
}

.action-bank-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 14px;
    gap: 7px;
}

.action-button {
    position: relative;
    display: grid;
    grid-template-columns: 35px minmax(0, 1fr) 24px;
    align-items: center;
    min-width: 0;
    min-height: 62px;
    padding: 8px;
    overflow: hidden;
    gap: 9px;
    text-align: left;
    background: #fbfcfc;
    border: 1px solid var(--line);
    border-radius: 11px;
    box-shadow: 0 2px 0 rgb(16 39 32 / 3%);
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease,
        transform 0.18s var(--ease),
        opacity 0.18s ease;
}

.action-button:not(:disabled):hover {
    z-index: 1;
    background: #fff;
    border-color: #8fc9b2;
    box-shadow: 0 8px 18px rgb(17 82 59 / 10%);
    transform: translateY(-2px);
}

.action-button:not(:disabled):active {
    box-shadow: 0 3px 8px rgb(17 82 59 / 8%);
    transform: translateY(0);
}

.action-button:disabled {
    color: #6f7b77;
    background: #f1f4f3;
    border-color: #e1e7e4;
    opacity: 0.63;
}

.action-icon {
    display: grid;
    width: 35px;
    height: 35px;
    place-items: center;
    color: var(--green-strong);
    background: var(--green-soft);
    border-radius: 9px;
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
}

.action-button > span:nth-child(2) {
    min-width: 0;
}

.action-button strong,
.action-button small {
    display: block;
}

.action-button strong {
    font-size: 13px;
    font-weight: 900;
    line-height: 1.4;
    white-space: normal;
}

.action-button small {
    margin-top: 1px;
    color: var(--ink-faint);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.35;
    white-space: normal;
}

.action-state {
    display: grid;
    width: 23px;
    height: 23px;
    place-items: center;
    color: #86938e;
    background: #e9eeec;
    border: 1px solid #d9e1de;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 900;
}

.action-button.priority:not(:disabled) {
    background: var(--red-soft);
    border-color: #e7aaa7;
    box-shadow: 0 0 0 3px rgb(209 73 73 / 7%);
}

.action-button.priority:not(:disabled) .action-icon {
    color: #fff;
    background: var(--red);
    animation: priority-pulse 1.8s infinite;
}

.action-button.done,
.action-button.completed,
.action-button.is-complete,
.action-button.is-done,
.action-button[data-state="done"] {
    color: var(--green-deep);
    background: var(--green-pale);
    border-color: #9ed2bd;
}

.action-button.done .action-icon,
.action-button.completed .action-icon,
.action-button.is-complete .action-icon,
.action-button.is-done .action-icon,
.action-button[data-state="done"] .action-icon,
.action-button.done .action-state,
.action-button.completed .action-state,
.action-button.is-complete .action-state,
.action-button.is-done .action-state,
.action-button[data-state="done"] .action-state {
    color: #fff;
    background: var(--green);
    border-color: var(--green);
}

.action-button.in-progress,
.action-button.is-busy,
.action-button[data-state="working"] {
    background: var(--blue-soft);
    border-color: #a9c9ed;
}

.action-button.in-progress .action-icon,
.action-button.is-busy .action-icon,
.action-button[data-state="working"] .action-icon {
    color: #fff;
    background: var(--blue);
    animation: working-spin 1.1s linear infinite;
}

.action-button.wrong,
.action-button.failed,
.action-button.is-error,
.action-button.is-warning,
.action-button[data-state="error"] {
    background: var(--red-soft);
    border-color: #eab2af;
    animation: action-shake 0.35s ease;
}

.action-button.wrong .action-icon,
.action-button.failed .action-icon,
.action-button.is-error .action-icon,
.action-button.is-warning .action-icon,
.action-button[data-state="error"] .action-icon {
    color: #fff;
    background: var(--red);
}

.action-button.is-warning {
    color: #6d4a06;
    background: var(--yellow-soft);
    border-color: #e5ca7e;
    animation: none;
}

.action-button.is-warning .action-icon,
.action-button.is-warning .action-state {
    color: #3b2803;
    background: #e5ae39;
    border-color: #d99e25;
}

/* Virtual file system */

.filesystem-card {
    margin-top: 14px;
    overflow: hidden;
    background: #f8faf9;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.filesystem-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 16px 12px;
    gap: 12px;
}

.filesystem-heading h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 900;
}

.scan-badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 9px;
    color: #65736e;
    background: #e8eeeb;
    border: 1px solid #d8e1dd;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.scan-badge.scanning,
.scan-badge.is-scanning {
    color: #1f5e9d;
    background: var(--blue-soft);
    border-color: #b9d2ef;
}

.scan-badge.clean,
.scan-badge.is-clean {
    color: var(--green-strong);
    background: var(--green-soft);
    border-color: #b8decd;
}

.scan-badge.infected,
.scan-badge.is-warning,
.scan-badge.is-danger {
    color: var(--red-strong);
    background: var(--red-soft);
    border-color: #ebbbb8;
}

.filesystem-toolbar {
    display: grid;
    grid-template-columns: 1fr 104px;
    padding: 7px 14px;
    color: var(--ink-faint);
    background: #edf2f0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.07em;
}

.file-tree {
    position: relative;
    min-height: 162px;
    max-height: 300px;
    overflow: auto;
    background: #fff;
    scrollbar-color: #9cb2a9 transparent;
    scrollbar-width: thin;
}

.file-tree:empty::before {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #7c8a85;
    content: "ゲーム開始後に疑似ファイルを表示します";
    font-size: 13px;
    font-weight: 750;
}

.file-folder + .file-folder {
    border-top: 1px solid var(--line);
}

.file-folder > .folder-name {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    min-height: 35px;
    padding: 6px 14px;
    gap: 7px;
    color: #365148;
    background: #f2f6f4;
    border-bottom: 1px solid #e0e8e5;
    font-size: 13px;
}

.file-folder > .folder-name strong {
    overflow: hidden;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-count {
    color: #71817b;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.file-tree::-webkit-scrollbar,
.browser-viewport::-webkit-scrollbar,
.event-log ol::-webkit-scrollbar,
#eventLog::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.file-tree::-webkit-scrollbar-thumb,
.browser-viewport::-webkit-scrollbar-thumb,
#eventLog::-webkit-scrollbar-thumb {
    background: #9cb2a9;
    border: 2px solid transparent;
    border-radius: 99px;
    background-clip: padding-box;
}

.file-row,
.tree-row,
.file-item,
.folder-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px;
    align-items: center;
    min-height: 34px;
    padding: 5px 14px;
    gap: 10px;
    border-bottom: 1px solid #edf1ef;
    font-family:
        ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.file-row:hover,
.tree-row:hover,
.file-item:hover,
.folder-row:hover {
    background: #f5f9f7;
}

.file-name,
.tree-name,
.folder-name {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
    overflow-wrap: anywhere;
}

.file-icon,
.folder-icon {
    flex: 0 0 auto;
    color: #749087;
    font-size: 14px;
}

.file-status,
.status-pill {
    justify-self: end;
    padding: 3px 7px;
    color: #5d6c66;
    background: #edf2f0;
    border-radius: 999px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.file-row.infected,
.tree-row.infected,
.file-item.infected,
.file-row.status-infected,
.file-row.is-infected,
.tree-row.is-infected,
.file-item.is-infected {
    color: #8e272d;
    background: #fff2f1;
    border-left: 3px solid var(--red);
    animation: infection-enter 0.42s var(--ease);
}

.infected .file-icon,
.infected .folder-icon,
.is-infected .file-icon,
.is-infected .folder-icon {
    color: var(--red);
}

.infected .file-status,
.infected .status-pill,
.file-row.status-infected .file-status,
.is-infected .file-status,
.is-infected .status-pill {
    color: #fff;
    background: var(--red);
}

.file-row.suspicious,
.tree-row.suspicious,
.file-item.suspicious,
.file-row.status-vulnerable,
.file-row.is-suspicious,
.tree-row.is-suspicious,
.file-item.is-suspicious {
    color: #765106;
    background: #fff9e9;
    border-left: 3px solid var(--yellow);
}

.suspicious .file-status,
.suspicious .status-pill,
.file-row.status-vulnerable .file-status,
.is-suspicious .file-status,
.is-suspicious .status-pill {
    color: #694605;
    background: #f5d881;
}

.file-row.clean,
.tree-row.clean,
.file-item.clean,
.file-row.status-clean,
.file-row.is-clean,
.tree-row.is-clean,
.file-item.is-clean {
    color: var(--green-deep);
    background: #f2fbf7;
}

.clean .file-status,
.clean .status-pill,
.file-row.status-clean .file-status,
.is-clean .file-status,
.is-clean .status-pill {
    color: var(--green-strong);
    background: var(--green-soft);
}

.file-row.reappeared,
.tree-row.reappeared,
.file-item.reappeared,
.file-row.is-new,
.tree-row.is-new,
.file-item.is-new {
    animation: file-reappear 0.75s var(--ease);
}

.file-children,
.tree-children {
    padding-left: 15px;
}

.tree-depth-1 {
    padding-left: 30px;
}

.tree-depth-2 {
    padding-left: 47px;
}

.tree-depth-3 {
    padding-left: 64px;
}

.file-row.status-unknown {
    color: #65736e;
    background: #fbfcfc;
}

.file-status.status-infected {
    color: #fff;
    background: var(--red);
}

.file-status.status-vulnerable {
    color: #684405;
    background: #f5d881;
}

.file-status.status-clean {
    color: var(--green-strong);
    background: var(--green-soft);
}

.file-status.status-unknown {
    color: #64736d;
    background: #e7edeb;
}

.file-detail {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: #84918c;
    font-size: 13px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.safe-note {
    margin: 0;
    padding: 10px 14px;
    color: #64746e;
    background: #f4f8f6;
    border-top: 1px solid var(--line);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
}

/* Live damage panel */

.live-indicator {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    gap: 6px;
    color: #ffbbbb;
    background: rgb(209 73 73 / 12%);
    border: 1px solid rgb(255 135 135 / 20%);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 950;
    letter-spacing: 0.08em;
}

.live-indicator i {
    width: 7px;
    height: 7px;
    background: #ff6262;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgb(255 98 98 / 55%);
    animation: live-pulse 1.6s infinite;
}

.damage-counters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 13px;
    gap: 7px;
}

.damage-counters > div {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    min-width: 0;
    min-height: 60px;
    padding: 8px;
    column-gap: 6px;
    background: rgb(255 255 255 / 5%);
    border: 1px solid rgb(255 255 255 / 8%);
    border-radius: 10px;
}

.damage-counters > div > span {
    grid-row: 1 / 3;
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    color: #ff8f8f;
    background: rgb(209 73 73 / 14%);
    border-radius: 7px;
    font-size: 13px;
}

.damage-counters strong {
    min-width: 0;
    overflow: hidden;
    color: #fff;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.damage-counters small {
    overflow: hidden;
    color: #9fb5ac;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.danger-text {
    color: #ff9797 !important;
    text-shadow: 0 0 9px rgb(255 80 80 / 35%);
}

.monitor-card {
    overflow: hidden;
    background: #f8faf9;
    border: 1px solid rgb(255 255 255 / 12%);
    border-radius: var(--radius);
    box-shadow: 0 10px 28px rgb(0 0 0 / 22%);
}

.monitor-card.damage-flash,
.monitor-card.is-attacked,
.damage-panel.flash-damage .monitor-card {
    animation: monitor-hit 0.55s ease;
}

.monitor-tabs {
    display: flex;
    padding: 6px;
    overflow-x: auto;
    gap: 4px;
    background: #eaf0ed;
    border-bottom: 1px solid #d1dcd7;
    scrollbar-width: none;
}

.monitor-tabs::-webkit-scrollbar {
    display: none;
}

.monitor-tabs button {
    flex: 1 0 auto;
    min-height: 31px;
    padding: 6px 9px;
    color: #5e6e67;
    background: transparent;
    border: 0;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 850;
    white-space: nowrap;
    transition:
        color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}

.monitor-tabs button:hover {
    color: var(--ink);
    background: rgb(255 255 255 / 60%);
}

.monitor-tabs button[aria-selected="true"],
.monitor-tabs button.active {
    color: var(--green-deep);
    background: #fff;
    box-shadow: 0 2px 7px rgb(17 55 42 / 10%);
}

.browser-frame {
    background: #fff;
}

.browser-chrome {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 14px;
    align-items: center;
    min-height: 35px;
    padding: 6px 9px;
    gap: 8px;
    color: #7b8a84;
    background: #f0f3f2;
    border-bottom: 1px solid #dce4e1;
    font-size: 13px;
}

.browser-dots {
    display: flex;
    gap: 4px;
}

.browser-dots i {
    display: block;
    width: 7px;
    height: 7px;
    background: #e56b67;
    border-radius: 50%;
}

.browser-dots i:nth-child(2) {
    background: #e6b34e;
}

.browser-dots i:nth-child(3) {
    background: #5bb78f;
}

.address-bar {
    min-width: 0;
    padding: 3px 9px;
    overflow: hidden;
    color: #50615a;
    background: #fff;
    border: 1px solid #d8e0dd;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.address-bar.danger,
.address-bar.is-redirected {
    color: #a92e34;
    background: #fff1f0;
    border-color: #ecaaa7;
}

.browser-viewport {
    position: relative;
    min-height: 190px;
    max-height: min(30vh, 340px);
    overflow: auto;
    color: #1f2b27;
    background: #fff;
    scrollbar-color: #aab9b3 transparent;
    scrollbar-width: thin;
}

.browser-viewport:empty::before {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 30px;
    color: #74827d;
    content: "ゲーム開始後に訪問者画面を表示します";
    background:
        linear-gradient(#f0f4f2 0 0) 18px 22px / 42% 13px no-repeat,
        linear-gradient(#f4f6f5 0 0) 18px 47px / calc(100% - 36px) 8px no-repeat,
        linear-gradient(#f4f6f5 0 0) 18px 64px / 70% 8px no-repeat;
    font-size: 13px;
    font-weight: 750;
    text-align: center;
}

.cause-banner {
    display: flex;
    align-items: flex-start;
    padding: 10px 12px;
    gap: 8px;
    color: #702126;
    background: var(--red-soft);
    border-top: 1px solid #edbfbc;
}

.cause-banner > span {
    display: grid;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    place-items: center;
    color: #fff;
    background: var(--red);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 900;
}

.cause-banner p {
    margin: 0;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.5;
}

/* Dynamic monitor view helpers */

.site-preview,
.visitor-view,
.search-view,
.admins-view,
.files-view,
.infection-view {
    min-height: 315px;
    animation: view-enter 0.28s var(--ease);
}

.demo-site-header,
.site-preview-header,
.site-header-preview,
.fake-site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 10px 16px;
    color: #fff;
    background: #254d40;
    font-size: 13px;
    font-weight: 850;
}

.demo-site-nav,
.fake-nav {
    display: flex;
    gap: 11px;
    color: #d8e9e2;
    font-size: 13px;
}

.demo-site-hero,
.site-hero,
.site-hero-preview,
.fake-hero {
    padding: 25px 18px;
    background: linear-gradient(125deg, #e7f5ef, #f8fbfa);
}

.demo-site-hero h3,
.site-hero h3,
.site-hero-preview h3,
.fake-hero h3 {
    max-width: 390px;
    margin: 0 0 7px;
    font-size: 20px;
    line-height: 1.4;
}

.demo-site-hero p,
.site-hero p,
.site-hero-preview p,
.fake-hero p {
    max-width: 420px;
    margin: 0;
    color: #52645d;
    font-size: 13px;
}

.demo-posts,
.site-posts,
.fake-posts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 13px;
    gap: 8px;
}

.demo-post,
.site-post,
.fake-post {
    min-width: 0;
    padding: 11px;
    background: #fff;
    border: 1px solid #e0e7e4;
    border-radius: 8px;
    box-shadow: 0 3px 9px rgb(15 47 36 / 5%);
}

.demo-post h4,
.site-post h4,
.fake-post h4 {
    margin: 0 0 5px;
    font-size: 13px;
    line-height: 1.4;
}

.demo-post p,
.site-post p,
.fake-post p {
    margin: 0;
    color: #6a7772;
    font-size: 13px;
}

.spam-text,
.spam-link,
.injected-spam {
    color: var(--red-strong) !important;
    background: #fff0ef;
    box-shadow: 0 0 0 3px #fff0ef;
    text-decoration-color: var(--red);
}

.site-preview .maintenance-banner {
    padding: 7px 12px;
    color: #5f4708;
    background: #fff1c9;
    border-bottom: 1px solid #ecd38a;
    font-size: 13px;
    font-weight: 850;
    text-align: center;
}

.site-preview > article {
    margin: 13px;
    padding: 13px;
    background: #fff;
    border: 1px solid #e0e7e4;
    border-radius: 8px;
}

.site-preview > article h4 {
    margin: 0 0 5px;
    font-size: 13px;
}

.site-preview > article p {
    margin: 0;
    color: #697872;
    font-size: 13px;
}

.spam-warning {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 11px 13px 0;
    padding: 8px 10px;
    gap: 10px;
    color: #8e272d;
    background: #fff0ef;
    border: 1px solid #edb6b3;
    border-radius: 7px;
    font-size: 13px;
}

.spam-warning strong {
    font-weight: 900;
}

.spam-snippet {
    margin: 7px 13px 0;
    padding: 9px 11px;
    color: #7a2429;
    background: repeating-linear-gradient(-45deg, #fff6f5, #fff6f5 7px, #fff0ef 7px, #fff0ef 14px);
    border-left: 3px solid var(--red);
    border-radius: 5px;
}

.spam-snippet small {
    color: #a03a40;
    font-size: 13px;
    font-weight: 850;
}

.spam-snippet p {
    margin: 2px 0 0;
    font-size: 13px;
}

.spam-snippet span {
    color: var(--red-strong);
    font-weight: 900;
    text-decoration: underline;
}

.redirect-screen,
.casino-screen,
.casino-redirect,
.fake-casino {
    position: relative;
    display: grid;
    min-height: 315px;
    padding: 28px 20px;
    place-items: center;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 15% 20%, rgb(255 215 68 / 28%), transparent 12rem),
        radial-gradient(circle at 92% 80%, rgb(255 80 117 / 25%), transparent 14rem),
        linear-gradient(145deg, #281052, #070510 75%);
    text-align: center;
}

.redirect-screen::before,
.casino-screen::before,
.casino-redirect::before,
.fake-casino::before {
    position: absolute;
    inset: 0;
    opacity: 0.22;
    content: "◆  ★  ◆  ★  ◆  ★  ◆  ★  ◆";
    font-size: 24px;
    line-height: 3.7;
    letter-spacing: 0.3em;
    transform: rotate(-15deg) scale(1.4);
}

.redirect-screen > *,
.casino-screen > *,
.casino-redirect > *,
.fake-casino > * {
    position: relative;
    z-index: 1;
}

.casino-redirect .demo-ribbon {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 8px;
    color: #fff;
    background: var(--red);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 900;
}

.casino-brand {
    display: grid;
    width: 65px;
    height: 65px;
    margin: 14px auto 7px;
    place-items: center;
    color: #281052;
    background: linear-gradient(145deg, #ffe680, #dca922);
    border: 4px solid rgb(255 255 255 / 30%);
    border-radius: 50%;
    box-shadow: 0 0 26px rgb(255 216 83 / 38%);
    font-size: 31px;
}

.casino-redirect h3 {
    margin: 0;
    color: #ffe172;
    font-size: 25px;
    letter-spacing: 0.06em;
}

.casino-redirect p {
    margin: 4px 0 14px;
    color: #ebdefc;
    font-size: 13px;
}

.casino-redirect button {
    padding: 8px 12px;
    color: #332406;
    background: #f4ce58;
    border: 0;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 850;
}

.redirect-warning,
.casino-warning {
    display: inline-block;
    padding: 5px 9px;
    color: #fff;
    background: var(--red);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.search-view,
.search-results,
.serp-preview {
    padding: 18px;
    background: #fff;
}

.search-brand,
.google-logo {
    margin-bottom: 13px;
    color: #316dc2;
    font-size: 21px;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.search-box,
.serp-searchbar,
.fake-search-box {
    margin-bottom: 16px;
    padding: 8px 12px;
    color: #4d5b56;
    border: 1px solid #d5dedb;
    border-radius: 999px;
    box-shadow: 0 2px 7px rgb(20 45 36 / 7%);
    font-size: 13px;
}

.search-result {
    margin-bottom: 14px;
}

.serp-brand {
    margin-bottom: 12px;
    color: #326cbf;
    font-size: 19px;
    font-weight: 900;
}

.serp-brand > span {
    margin-left: 5px;
    padding: 3px 6px;
    color: #63716b;
    background: #edf2f0;
    border-radius: 999px;
    font-size: 13px;
    letter-spacing: 0;
    vertical-align: 3px;
}

.serp-result {
    margin-bottom: 14px;
}

.serp-url {
    color: #26704f;
    font-size: 13px;
}

.serp-result h3 {
    margin: 1px 0 2px;
    color: #315ca8;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}

.serp-result p {
    margin: 0;
    color: #59665f;
    font-size: 13px;
}

.serp-polluted {
    padding: 9px;
    background: #fff2f1;
    border-left: 3px solid var(--red);
    border-radius: 5px;
}

.serp-polluted h3 {
    color: var(--red-strong);
}

.recovery-pending {
    padding: 8px 10px;
    color: #684a08 !important;
    background: var(--yellow-soft);
    border: 1px solid #ead28e;
    border-radius: 7px;
    font-size: 13px !important;
    font-weight: 750;
}

.search-result .url,
.search-url {
    color: #23704f;
    font-size: 13px;
}

.search-result h3,
.search-title {
    margin: 1px 0 2px;
    color: #315ca8;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}

.search-result p,
.search-snippet {
    margin: 0;
    color: #59665f;
    font-size: 13px;
}

.search-result.polluted,
.search-result.infected,
.search-result.is-polluted {
    padding: 9px;
    background: #fff2f1;
    border-left: 3px solid var(--red);
    border-radius: 5px;
}

.search-result.polluted .search-title,
.search-result.infected .search-title,
.search-result.is-polluted .search-title {
    color: #a52d33;
}

.admins-view,
.admin-view,
.admin-list,
.admin-preview {
    padding: 16px;
    background: #f7f9f8;
}

.admin-preview > h3 {
    margin: 0 0 10px;
    font-size: 13px;
}

.admin-preview > h3 small {
    margin-left: 4px;
    color: #73817c;
    font-size: 13px;
}

.admin-detail strong,
.admin-detail small {
    display: block;
}

.admin-detail small {
    color: #75827d;
    font-size: 13px;
}

.admin-preview > .empty-state {
    margin: 0;
    padding: 22px 10px;
    color: #687770;
    background: #fff;
    border: 1px dashed #cbd7d2;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}

.admin-table {
    overflow: hidden;
    background: #fff;
    border: 1px solid #dce4e1;
    border-radius: 9px;
}

.admin-row,
.admin-item {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    min-height: 49px;
    padding: 7px 10px;
    gap: 9px;
    border-bottom: 1px solid #e8edeb;
    font-size: 13px;
}

.admin-row:last-child,
.admin-item:last-child {
    border-bottom: 0;
}

.admin-avatar {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    color: #fff;
    background: #839b91;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 900;
}

.admin-info strong,
.admin-name {
    display: block;
    font-weight: 850;
}

.admin-info small,
.admin-email {
    color: #72817b;
    font-size: 13px;
}

.admin-role {
    padding: 3px 6px;
    color: #52615b;
    background: #edf2f0;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 850;
}

.admin-row.rogue,
.admin-item.rogue,
.admin-row.is-rogue,
.admin-item.is-rogue {
    color: #91282e;
    background: #fff1f0;
    border-left: 3px solid var(--red);
    animation: infection-enter 0.42s var(--ease);
}

.rogue .admin-avatar,
.is-rogue .admin-avatar {
    background: var(--red);
}

.rogue .admin-role,
.is-rogue .admin-role {
    color: #fff;
    background: var(--red);
}

.files-view,
.infection-view,
.infection-map {
    padding: 17px;
    background:
        linear-gradient(rgb(35 79 63 / 4%) 1px, transparent 1px),
        linear-gradient(90deg, rgb(35 79 63 / 4%) 1px, transparent 1px), #f7faf8;
    background-size: 22px 22px;
}

.map-root,
.map-node,
.infection-node {
    position: relative;
    padding: 7px 9px;
    color: #365047;
    background: #fff;
    border: 1px solid #ccd9d4;
    border-radius: 7px;
    box-shadow: 0 3px 8px rgb(18 55 42 / 7%);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    font-weight: 750;
}

.map-node.infected,
.infection-node.infected,
.map-node.is-infected,
.infection-node.is-infected {
    color: #8e272d;
    background: #fff0ef;
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgb(209 73 73 / 9%);
}

.map-connections,
.infection-branches {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 22px;
    gap: 10px;
}

.infection-map > h3 {
    margin: 0 0 3px;
    font-size: 13px;
}

.infection-map > p {
    margin: 0 0 13px;
    color: #64756e;
    font-size: 13px;
}

.map-folder {
    display: grid;
    grid-template-columns: minmax(100px, 0.8fr) minmax(0, 1.2fr);
    align-items: center;
    min-height: 39px;
    padding: 7px 9px;
    gap: 9px;
    background: rgb(255 255 255 / 90%);
    border: 1px solid #d4dfdb;
    border-radius: 7px;
    box-shadow: 0 2px 6px rgb(18 55 42 / 5%);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
}

.map-folder + .map-folder {
    margin-top: 7px;
}

.map-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

.infection-dot,
.clean-dot {
    display: block;
    width: 10px;
    height: 10px;
    background: var(--green);
    border: 2px solid #c9eadc;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #6eaf95;
}

.infection-dot {
    background: var(--red);
    border-color: #ffd0ce;
    box-shadow:
        0 0 0 1px #d86666,
        0 0 7px rgb(209 73 73 / 48%);
    animation: live-pulse 1.8s infinite;
}

/* Lesson and event log */

.lesson-card {
    display: flex;
    align-items: flex-start;
    margin-top: 13px;
    padding: 12px 13px;
    gap: 10px;
    color: #ffe9a8;
    background: rgb(200 137 18 / 10%);
    border: 1px solid rgb(232 190 92 / 20%);
    border-radius: 11px;
}

.lesson-icon {
    display: grid;
    flex: 0 0 25px;
    width: 25px;
    height: 25px;
    place-items: center;
    color: #302002;
    background: #efbd4f;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 950;
}

.lesson-card h3 {
    margin: 0 0 2px;
    color: #ffe39a;
    font-size: 13px;
    font-weight: 900;
}

.lesson-card p {
    margin: 0;
    color: #d9ccb1;
    font-size: 13px;
    line-height: 1.55;
}

.event-log {
    margin-top: 13px;
    overflow: hidden;
    background: rgb(255 255 255 / 4%);
    border: 1px solid rgb(255 255 255 / 8%);
    border-radius: 11px;
}

.event-log-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 39px;
    padding: 8px 11px;
    background: rgb(255 255 255 / 4%);
    border-bottom: 1px solid rgb(255 255 255 / 7%);
}

.event-log-heading h3 {
    margin: 0;
    color: #e8f3ef;
    font-size: 13px;
    font-weight: 850;
}

.event-log-heading span {
    color: #9fb4ac;
    font-size: 13px;
    font-weight: 800;
}

#eventLog {
    max-height: 162px;
    margin: 0;
    padding: 0;
    overflow: auto;
    list-style: none;
    scrollbar-color: #4d6c60 transparent;
    scrollbar-width: thin;
}

#eventLog:empty::before {
    display: block;
    padding: 22px 14px;
    color: #829b91;
    content: "ゲーム開始後、攻撃と作業の記録を表示します";
    font-size: 13px;
    text-align: center;
}

#eventLog > .empty-state {
    display: block;
    min-height: 0;
    padding: 22px 14px;
    color: #829b91;
    background: transparent;
    font-size: 13px;
    text-align: center;
}

#eventLog > .empty-state::before {
    display: none;
}

#eventLog li {
    position: relative;
    display: grid;
    grid-template-columns: 42px 17px minmax(0, 1fr);
    align-items: start;
    min-height: 35px;
    padding: 8px 10px;
    gap: 5px;
    color: #cadbd4;
    border-bottom: 1px solid rgb(255 255 255 / 5%);
    font-size: 13px;
    line-height: 1.45;
    animation: log-enter 0.3s var(--ease);
}

#eventLog li:last-child {
    border-bottom: 0;
}

#eventLog li::before {
    display: grid;
    width: 15px;
    height: 15px;
    grid-column: 2;
    place-items: center;
    color: #fff;
    content: "i";
    background: #527568;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 900;
}

#eventLog li > *:first-child,
#eventLog .log-time,
#eventLog time {
    grid-column: 1;
    grid-row: 1;
    color: #779187;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

#eventLog .log-message,
#eventLog li > *:last-child {
    grid-column: 3;
}

#eventLog li.attack,
#eventLog li.danger,
#eventLog li.is-attack,
#eventLog li.log-attack {
    color: #ffd1d1;
    background: rgb(209 73 73 / 8%);
}

#eventLog li.attack::before,
#eventLog li.danger::before,
#eventLog li.is-attack::before,
#eventLog li.log-attack::before {
    content: "!";
    background: var(--red);
}

#eventLog li.warning,
#eventLog li.is-warning,
#eventLog li.log-warning {
    color: #ffe7ad;
    background: rgb(200 137 18 / 7%);
}

#eventLog li.warning::before,
#eventLog li.is-warning::before,
#eventLog li.log-warning::before {
    content: "!";
    color: #392503;
    background: #e4ad37;
}

#eventLog li.success,
#eventLog li.action,
#eventLog li.is-success,
#eventLog li.log-action,
#eventLog li.log-success {
    color: #c8efdf;
    background: rgb(46 166 116 / 7%);
}

#eventLog li.success::before,
#eventLog li.action::before,
#eventLog li.is-success::before,
#eventLog li.log-action::before,
#eventLog li.log-success::before {
    content: "✓";
    background: var(--green);
}

/* Dialogs */

.overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    padding: 24px;
    overflow-y: auto;
    place-items: center;
    background: rgb(4 22 16 / 76%);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.intro-dialog,
.result-dialog {
    position: relative;
    width: min(100%, 980px);
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: #fff;
    border: 1px solid rgb(255 255 255 / 45%);
    border-radius: 26px;
    box-shadow: var(--shadow-lg);
    transform: translateY(18px) scale(0.985);
    transition: transform 0.32s var(--ease);
}

.overlay.active .intro-dialog,
.overlay.active .result-dialog {
    transform: translateY(0) scale(1);
}

.intro-dialog {
    display: grid;
    grid-template-columns: minmax(290px, 0.88fr) minmax(430px, 1.12fr);
    overflow: hidden;
}

.intro-visual {
    position: relative;
    display: grid;
    min-height: 610px;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 47%, rgb(55 205 146 / 22%), transparent 13rem),
        linear-gradient(145deg, #173c30, #071d16);
}

.intro-visual::before {
    position: absolute;
    inset: -40%;
    opacity: 0.16;
    content: "";
    background-image:
        linear-gradient(rgb(128 226 189 / 35%) 1px, transparent 1px),
        linear-gradient(90deg, rgb(128 226 189 / 35%) 1px, transparent 1px);
    background-size: 32px 32px;
    transform: perspective(420px) rotateX(62deg) translateY(19%);
}

.intro-visual::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(
        90deg,
        transparent 49.8%,
        rgb(114 235 188 / 9%) 50%,
        transparent 50.2%
    );
}

.shield-mark {
    position: relative;
    z-index: 3;
    display: grid;
    width: 132px;
    height: 148px;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg, #2ab882, var(--green-strong));
    border: 2px solid rgb(255 255 255 / 32%);
    border-radius: 46% 46% 58% 58% / 28% 28% 72% 72%;
    box-shadow:
        0 0 0 14px rgb(54 205 147 / 7%),
        0 28px 50px rgb(0 0 0 / 28%),
        inset 0 1px 0 rgb(255 255 255 / 40%);
    font-size: 68px;
    font-weight: 950;
    line-height: 1;
    text-shadow: 0 5px 15px rgb(0 0 0 / 20%);
}

.infection-orbit {
    position: absolute;
    z-index: 2;
    border: 1px solid rgb(118 230 187 / 25%);
    border-radius: 50%;
    animation: orbit-rotate 12s linear infinite;
}

.infection-orbit i {
    position: absolute;
    display: block;
    width: 12px;
    height: 12px;
    background: #ef6565;
    border: 2px solid #ffb3b3;
    border-radius: 50%;
    box-shadow: 0 0 16px #e94949;
}

.orbit-one {
    width: 242px;
    height: 242px;
}

.orbit-one i:nth-child(1) {
    top: -6px;
    left: calc(50% - 6px);
}

.orbit-one i:nth-child(2) {
    top: 64%;
    right: -4px;
}

.orbit-one i:nth-child(3) {
    bottom: 10%;
    left: 9%;
}

.orbit-two {
    width: 340px;
    height: 340px;
    animation-direction: reverse;
    animation-duration: 18s;
}

.orbit-two i:nth-child(1) {
    top: 16%;
    right: 7%;
}

.orbit-two i:nth-child(2) {
    bottom: 7%;
    left: 24%;
}

.intro-content {
    align-self: center;
    padding: clamp(32px, 5vw, 58px);
}

.intro-logo-link {
    display: inline-block;
    margin: 0 0 18px;
}

.intro-logo {
    display: block;
    height: 30px;
    width: auto;
}

.intro-content h2 {
    margin: 0 0 14px;
    font-size: clamp(28px, 3vw, 36px);
    font-weight: 950;
    letter-spacing: -0.045em;
    line-height: 1.28;
}

.intro-lead {
    margin-bottom: 22px;
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 650;
}

.intro-points {
    display: grid;
    margin: 0 0 22px;
    padding: 0;
    gap: 9px;
    list-style: none;
}

.intro-points li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #3d5049;
    font-size: 13px;
    font-weight: 750;
}

.intro-points li span {
    display: grid;
    flex: 0 0 25px;
    width: 25px;
    height: 25px;
    place-items: center;
    color: var(--green-strong);
    background: var(--green-soft);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 950;
}

.mode-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 0 18px;
    padding: 0;
    gap: 8px;
    border: 0;
}

.mode-picker legend {
    width: 100%;
    margin-bottom: 7px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.05em;
}

.mode-picker label {
    position: relative;
    display: block;
}

.mode-picker input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.mode-picker label > span {
    display: block;
    min-height: 70px;
    padding: 12px 12px 10px 38px;
    background: #f7f9f8;
    border: 1px solid var(--line);
    border-radius: 11px;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.mode-picker label > span::before {
    position: absolute;
    top: 18px;
    left: 13px;
    width: 15px;
    height: 15px;
    content: "";
    background: #fff;
    border: 2px solid #a6b4af;
    border-radius: 50%;
    box-shadow: inset 0 0 0 3px #fff;
}

.mode-picker input:checked + span {
    background: var(--green-pale);
    border-color: #82c6aa;
    box-shadow: 0 0 0 3px rgb(22 135 95 / 7%);
}

.mode-picker input:checked + span::before {
    background: var(--green);
    border-color: var(--green);
}

.mode-picker input:focus-visible + span {
    outline: 3px solid #75b9ff;
    outline-offset: 3px;
}

.mode-picker strong,
.mode-picker small {
    display: block;
}

.mode-picker strong {
    font-size: 13px;
    font-weight: 900;
}

.mode-picker small {
    margin-top: 2px;
    color: var(--ink-faint);
    font-size: 13px;
    line-height: 1.4;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 12px 20px;
    border-radius: 11px;
    font-weight: 900;
    text-decoration: none;
    transition:
        transform 0.18s var(--ease),
        box-shadow 0.18s ease,
        background 0.18s ease;
}

.primary-button {
    width: 100%;
    gap: 12px;
    color: #fff;
    background: linear-gradient(135deg, #1ca271, var(--green-strong));
    border: 1px solid var(--green-strong);
    box-shadow: 0 12px 24px rgb(8 112 73 / 22%);
}

.primary-button:hover,
.secondary-button:hover {
    box-shadow: 0 15px 28px rgb(8 112 73 / 26%);
    transform: translateY(-2px);
}

.primary-button:active,
.secondary-button:active {
    box-shadow: 0 6px 13px rgb(8 112 73 / 18%);
    transform: translateY(0);
}

.intro-disclaimer {
    margin: 10px 0 0;
    color: var(--ink-faint);
    font-size: 13px;
    font-weight: 650;
    text-align: center;
}

/* Result dialog */

.result-dialog {
    width: min(100%, 790px);
    padding: clamp(24px, 4vw, 44px);
}

.dialog-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    color: #65736d;
    background: #f1f5f3;
    border: 1px solid var(--line);
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    transition:
        background 0.18s ease,
        color 0.18s ease;
}

.dialog-close:hover {
    color: var(--ink);
    background: #e6eeeb;
}

.result-heading {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-right: 35px;
    text-align: left;
}

.result-heading-text {
    min-width: 0;
}

.result-shield {
    display: grid;
    flex: 0 0 auto;
    width: 54px;
    height: 58px;
    margin: 0;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg, #2ab882, var(--green-strong));
    border-radius: 44% 44% 56% 56% / 30% 30% 70% 70%;
    box-shadow: 0 11px 23px rgb(8 112 73 / 23%);
    font-size: 24px;
    font-weight: 950;
}

.result-shield.warning,
.result-shield.tone-yellow {
    background: linear-gradient(145deg, #e3aa33, #ad7411);
    box-shadow: 0 11px 23px rgb(173 116 17 / 22%);
}

.result-shield.danger,
.result-shield.failed,
.result-shield.tone-red {
    background: linear-gradient(145deg, #df6565, var(--red-strong));
    box-shadow: 0 11px 23px rgb(170 44 51 / 22%);
}

.result-heading h2 {
    margin: 0 0 2px;
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 950;
    letter-spacing: -0.04em;
}

.result-heading-text > p:last-child {
    margin: 0;
    color: var(--ink-soft);
    font-size: 13px;
}

.result-score {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0 14px;
    padding: 14px 18px;
    gap: 18px;
    background: linear-gradient(110deg, var(--green-pale), #f8fbfa);
    border: 1px solid #b8dfce;
    border-radius: 14px;
}

.result-score > div {
    display: flex;
    align-items: baseline;
}

.result-score strong {
    color: var(--green-strong);
    font-size: 44px;
    font-variant-numeric: tabular-nums;
    font-weight: 950;
    letter-spacing: -0.055em;
    line-height: 1;
}

.result-score span {
    margin-left: 4px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 800;
}

.result-score p {
    margin: 0;
    padding: 5px 10px;
    color: #fff;
    background: var(--green);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 900;
}

.result-score.tone-yellow,
.result-score.warning {
    background: linear-gradient(110deg, var(--yellow-soft), #fffdf7);
    border-color: #e6cf8d;
}

.result-score.tone-yellow strong,
.result-score.warning strong {
    color: var(--yellow-strong);
}

.result-score.tone-yellow p,
.result-score.warning p {
    background: var(--yellow);
}

.result-score.tone-red,
.result-score.danger {
    background: linear-gradient(110deg, var(--red-soft), #fff8f7);
    border-color: #e9b7b4;
}

.result-score.tone-red strong,
.result-score.danger strong {
    color: var(--red-strong);
}

.result-score.tone-red p,
.result-score.danger p {
    background: var(--red);
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 16px;
    gap: 8px;
}

.result-stats > div {
    padding: 10px;
    background: #f5f8f7;
    border: 1px solid #e0e8e5;
    border-radius: 10px;
    text-align: center;
}

.result-stats span,
.result-stats strong {
    display: block;
}

.result-stats span {
    margin-bottom: 2px;
    color: var(--ink-faint);
    font-size: 13px;
    font-weight: 800;
}

.result-stats strong {
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    font-weight: 900;
}

.learning-summary {
    padding: 14px 16px;
    background: #f6f9f8;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.learning-summary h3 {
    margin: 0 0 7px;
    font-size: 13px;
    font-weight: 900;
}

.learning-summary ul {
    display: grid;
    margin: 0;
    padding: 0;
    gap: 5px;
    list-style: none;
}

.learning-summary li {
    position: relative;
    padding-left: 19px;
    color: #4e6059;
    font-size: 13px;
    font-weight: 700;
}

.learning-summary li::before {
    position: absolute;
    top: 0.15em;
    left: 0;
    display: grid;
    width: 14px;
    height: 14px;
    place-items: center;
    color: #fff;
    content: "✓";
    background: var(--green);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 900;
}

.reality-note {
    display: flex;
    align-items: flex-start;
    margin: 12px 0;
    padding: 11px 13px;
    gap: 9px;
    color: #6a500f;
    background: #fff8e6;
    border: 1px solid #ecdcae;
    border-radius: 10px;
}

.reality-note > span {
    display: grid;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    place-items: center;
    color: #fff;
    background: var(--yellow);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 900;
}

.reality-note p {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.55;
}

.service-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.service-card {
    position: relative;
    display: block;
    min-height: 105px;
    padding: 14px 37px 14px 15px;
    overflow: hidden;
    border-radius: 12px;
    text-decoration: none;
    transition:
        transform 0.18s var(--ease),
        box-shadow 0.18s ease;
}

.service-card::after {
    position: absolute;
    top: 50%;
    right: 14px;
    font-size: 19px;
    font-weight: 400;
    content: "→";
    transform: translateY(-50%);
    transition: transform 0.18s var(--ease);
}

.service-card:hover {
    box-shadow: 0 10px 22px rgb(18 49 38 / 14%);
    transform: translateY(-2px);
}

.service-card:hover::after {
    transform: translate(3px, -50%);
}

.service-card span,
.service-card strong,
.service-card small {
    display: block;
}

.service-card span {
    margin-bottom: 4px;
    font-size: 16px;
    font-weight: 850;
}

.service-card strong {
    margin-bottom: 3px;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.4;
}

.service-card small {
    opacity: 0.82;
    font-size: 13px;
    line-height: 1.45;
}

.service-card.urgent {
    color: #fff;
    background: linear-gradient(135deg, #d85252, #a82d34);
    border: 1px solid #9d252c;
}

.service-card.maintenance {
    color: #fff;
    background: linear-gradient(135deg, #1b9a6c, #086a46);
    border: 1px solid #075c3e;
}

.secondary-button {
    width: 100%;
    min-height: 43px;
    margin-top: 11px;
    color: var(--green-strong);
    background: #fff;
    border: 1px solid #94cdb6;
    box-shadow: none;
    font-size: 13px;
}

/* Toast and global runtime states */

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 2000;
    max-width: min(390px, calc(100vw - 40px));
    padding: 11px 15px;
    color: #fff;
    background: #173d31;
    border: 1px solid rgb(255 255 255 / 16%);
    border-radius: 10px;
    box-shadow: 0 14px 35px rgb(2 21 15 / 30%);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.5;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition:
        opacity 0.22s ease,
        transform 0.22s var(--ease);
}

.toast.show,
.toast.visible,
.toast.active {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: var(--green-deep);
}

.toast.warning {
    color: #332303;
    background: #e7b343;
    border-color: #f4d995;
}

.toast.error,
.toast.danger {
    background: var(--red-strong);
}

.app-shell.paused::after,
.app-shell.is-paused::after {
    position: fixed;
    inset: var(--header-height) 0 0;
    z-index: 75;
    display: grid;
    place-items: center;
    color: #fff;
    content: "一時停止中";
    background: rgb(4 22 16 / 52%);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    font-size: clamp(24px, 4vw, 42px);
    font-weight: 950;
    letter-spacing: 0.08em;
}

body.modal-open,
body.has-overlay {
    overflow: hidden;
}

/* Animations */

@keyframes priority-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgb(209 73 73 / 35%);
    }
    50% {
        box-shadow: 0 0 0 7px rgb(209 73 73 / 0%);
    }
}

@keyframes live-pulse {
    0% {
        box-shadow: 0 0 0 0 rgb(255 98 98 / 55%);
    }
    70%,
    100% {
        box-shadow: 0 0 0 7px rgb(255 98 98 / 0%);
    }
}

@keyframes working-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes orbit-rotate {
    to {
        transform: rotate(360deg);
    }
}

@keyframes infection-enter {
    0% {
        background: #ffcccc;
        transform: translateX(7px);
    }
    100% {
        transform: translateX(0);
    }
}

@keyframes file-reappear {
    0% {
        opacity: 0;
        background: #ffb6b3;
        transform: translateX(15px);
    }
    45% {
        opacity: 1;
    }
    100% {
        background: #fff2f1;
        transform: translateX(0);
    }
}

@keyframes action-shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-4px);
    }
    75% {
        transform: translateX(4px);
    }
}

@keyframes monitor-hit {
    0%,
    100% {
        box-shadow: 0 10px 28px rgb(0 0 0 / 22%);
        transform: translateX(0);
    }
    25% {
        box-shadow: 0 0 0 4px rgb(209 73 73 / 45%);
        transform: translateX(-3px);
    }
    55% {
        transform: translateX(3px);
    }
}

@keyframes log-enter {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes view-enter {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Medium screens */

@media (max-width: 1250px) {
    .status-ribbon {
        grid-template-columns: minmax(140px, 1fr) minmax(200px, 1.35fr) repeat(
                4,
                minmax(83px, 0.55fr)
            );
    }

    .game-layout {
        grid-template-columns: minmax(520px, 1.08fr) minmax(380px, 0.92fr);
    }

    .action-grid.three-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .damage-counters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .browser-viewport {
        min-height: 170px;
    }
}

@media (max-width: 1050px) {
    :root {
        --header-height: 68px;
    }

    .site-header {
        min-height: 68px;
    }

    .safe-demo-label {
        display: none;
    }

    .status-ribbon {
        grid-template-columns: minmax(125px, 1fr) minmax(180px, 1.4fr) repeat(
                4,
                minmax(80px, 0.65fr)
            );
    }

    .game-layout {
        grid-template-columns: minmax(470px, 1.06fr) minmax(350px, 0.94fr);
    }

    .action-bank-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .action-grid.two-columns,
    .action-grid.three-columns {
        grid-template-columns: 1fr;
    }
}

/* Phone/tablet panel switch */

@media (max-width: 860px) {
    :root {
        --header-height: 64px;
    }

    body {
        background: var(--page);
    }

    .app-shell {
        padding-bottom: 24px;
    }

    .site-header {
        position: relative;
        min-height: 64px;
        padding: 9px 13px;
    }

    .game-chrome {
        top: 0;
    }

    .brand-mark {
        height: 34px;
        padding: 4px 8px;
        border-radius: 8px;
    }

    .brand-name {
        display: none;
    }

    .brand-lockup h1 {
        max-width: 48vw;
        font-size: 15px;
    }

    .quiet-button {
        position: relative;
        min-width: 44px;
        min-height: 35px;
        padding: 6px 8px;
        overflow: hidden;
        font-size: 13px;
        text-indent: -9999px;
    }

    .quiet-button::after {
        position: absolute;
        inset: 0;
        display: grid;
        place-items: center;
        text-indent: 0;
    }

    #motionToggle::after {
        content: "動作";
        font-size: 13px;
    }

    #motionToggle[aria-pressed="true"]::after {
        content: "戻す";
    }

    #pauseButton::after {
        content: "停止";
        font-size: 13px;
    }

    #pauseButton[aria-pressed="true"]::after {
        content: "再開";
    }

    .status-ribbon {
        position: static;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-areas:
            "score health elapsed"
            "attack infected admin";
        height: auto;
        padding: 6px 9px;
        gap: 5px;
    }

    .status-card,
    .metric-card {
        min-height: 56px;
        padding: 5px 7px;
        border-radius: 10px;
        box-shadow: none;
    }

    #scoreCard {
        grid-area: score;
    }

    #healthCard {
        grid-area: health;
    }

    .elapsed-card {
        grid-area: elapsed;
    }

    .attack-clock-card {
        grid-area: attack;
    }

    .infected-card {
        grid-area: infected;
    }

    .admin-card {
        grid-area: admin;
    }

    .score-card {
        column-gap: 5px;
        padding-left: 12px;
    }

    .score-card strong {
        font-size: 27px;
    }

    .status-caption {
        display: none;
    }

    .status-label {
        margin-bottom: 2px;
        font-size: 13px;
    }

    .health-card {
        padding-left: 13px;
    }

    .health-card strong {
        font-size: 13px;
    }

    .health-card strong span {
        display: none;
    }

    .health-card .meter {
        height: 4px;
        margin-top: 3px;
    }

    .metric-card strong {
        font-size: 19px;
    }

    .status-ribbon .attack-clock-card,
    .status-ribbon .infected-card,
    .status-ribbon .admin-card {
        display: flex;
    }

    .mobile-view-switch {
        position: static;
        display: flex;
        margin: 0;
        padding: 7px 9px;
        gap: 5px;
        background: rgb(237 243 240 / 96%);
        border-bottom: 1px solid #d5dfdb;
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
    }

    .mobile-view-switch button {
        position: relative;
        flex: 1;
        min-height: 38px;
        padding: 7px 8px;
        color: #60716a;
        background: #fff;
        border: 1px solid #d5dfdb;
        border-radius: 9px;
        font-size: 13px;
        font-weight: 850;
    }

    .mobile-view-switch button.active,
    .mobile-view-switch button[aria-selected="true"] {
        color: #fff;
        background: var(--green-strong);
        border-color: var(--green-strong);
        box-shadow: 0 5px 12px rgb(8 112 73 / 18%);
    }

    .mobile-view-switch button span {
        position: absolute;
        top: -6px;
        right: -3px;
        display: grid;
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        place-items: center;
        color: #fff;
        background: var(--red);
        border: 2px solid var(--page);
        border-radius: 999px;
        font-size: 13px;
        font-weight: 900;
    }

    .game-layout {
        display: block;
        padding: 9px;
    }

    .game-layout > .mobile-panel {
        display: none;
    }

    .game-layout > .mobile-panel.active {
        display: block;
    }

    .game-layout > .damage-panel:has(> .event-log.active) {
        display: block;
    }

    .game-layout > .damage-panel:not(.active):has(> .event-log.active) {
        padding: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .game-layout > .damage-panel:not(.active):has(> .event-log.active) > :not(.event-log) {
        display: none;
    }

    .game-layout > .damage-panel.mobile-log-active {
        padding: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .game-layout > .damage-panel.mobile-log-active > :not(.event-log) {
        display: none;
    }

    .game-layout > .damage-panel.mobile-log-active > .event-log {
        display: block;
        margin-top: 0;
    }

    .damage-panel.active > .event-log:not(.active) {
        display: none;
    }

    .operations-panel,
    .damage-panel {
        border-radius: 15px;
    }

    .operations-panel {
        padding: 16px 13px;
    }

    .damage-panel {
        position: static;
        max-height: none;
        padding: 16px 13px;
        overflow: visible;
    }

    .panel-heading {
        margin-bottom: 12px;
    }

    .panel-heading h2 {
        font-size: 22px;
    }

    .action-grid.two-columns,
    .action-grid.three-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .action-button {
        grid-template-columns: 31px minmax(0, 1fr) 21px;
        min-height: 74px;
        padding: 8px;
        gap: 7px;
    }

    .action-icon {
        width: 31px;
        height: 31px;
    }

    .action-state {
        width: 24px;
        height: 24px;
        font-size: 13px;
    }

    .action-button strong {
        font-size: 13px;
    }

    .action-button small {
        font-size: 13px;
    }

    .browser-viewport,
    .site-preview,
    .visitor-view,
    .search-view,
    .admins-view,
    .files-view,
    .infection-view,
    .redirect-screen,
    .casino-screen,
    .fake-casino {
        min-height: 360px;
        max-height: none;
    }

    #eventLog {
        max-height: min(58vh, 520px);
    }

    .event-log.active {
        margin-top: 0;
        color: #e9f4f0;
        background: linear-gradient(145deg, var(--navy-2), #0c211a 78%);
        border-color: rgb(255 255 255 / 8%);
        box-shadow: var(--shadow-md);
    }

    .intro-dialog {
        grid-template-columns: 1fr;
        max-width: 620px;
    }

    .intro-visual {
        display: none;
    }

    .intro-content {
        padding: 34px;
    }

    .result-dialog {
        max-width: 650px;
    }
}

@media (max-width: 560px) {
    .overlay {
        padding: 10px;
        place-items: start center;
    }

    .intro-dialog,
    .result-dialog {
        max-height: none;
        margin: 8px 0;
        border-radius: 18px;
    }

    .intro-content {
        padding: 26px 20px 22px;
    }

    .intro-logo-link {
        margin-bottom: 14px;
    }

    .intro-logo {
        height: 24px;
    }

    .intro-content h2 {
        font-size: 28px;
    }

    .intro-lead {
        font-size: 13px;
    }

    .mode-picker {
        grid-template-columns: 1fr;
    }

    .mode-picker label > span {
        min-height: 61px;
    }

    .status-ribbon {
        grid-template-columns: 0.82fr 1.35fr 0.75fr;
        gap: 5px;
    }

    .status-card,
    .metric-card {
        min-width: 0;
    }

    .score-card strong {
        font-size: 24px;
    }

    .score-card strong small,
    .metric-card strong small {
        font-size: 13px;
    }

    .health-card strong {
        overflow: hidden;
        font-size: 13px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .metric-card strong {
        font-size: 17px;
    }

    .mobile-view-switch {
        top: auto;
    }

    .panel-heading {
        align-items: flex-start;
    }

    .hint-button {
        min-height: 36px;
        padding: 7px 9px;
        font-size: 13px;
    }

    .hint-button small {
        display: none;
    }

    .objective-card {
        padding: 12px;
    }

    .objective-card p {
        font-size: 13px;
    }

    .action-grid.two-columns,
    .action-grid.three-columns,
    .action-bank-grid {
        grid-template-columns: 1fr;
    }

    .action-button {
        grid-template-columns: 35px minmax(0, 1fr) 24px;
        min-height: 70px;
        padding: 8px 10px;
    }

    .action-icon {
        width: 35px;
        height: 35px;
    }

    .action-button strong {
        font-size: 13px;
    }

    .action-button small {
        font-size: 13px;
    }

    .damage-counters {
        gap: 5px;
    }

    .damage-counters > div {
        min-height: 55px;
        padding: 6px;
    }

    .damage-counters > div > span {
        width: 22px;
        height: 22px;
    }

    .damage-counters strong {
        font-size: 16px;
    }

    .monitor-tabs button {
        padding: 6px 8px;
        font-size: 13px;
    }

    .browser-viewport,
    .site-preview,
    .visitor-view,
    .search-view,
    .admins-view,
    .files-view,
    .infection-view,
    .redirect-screen,
    .casino-screen,
    .fake-casino {
        min-height: 315px;
    }

    .demo-posts,
    .site-posts,
    .fake-posts {
        grid-template-columns: 1fr;
    }

    .result-dialog {
        padding: 27px 18px 20px;
    }

    .result-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .service-options {
        grid-template-columns: 1fr;
    }

    .result-score {
        gap: 12px;
    }

    .result-score strong {
        font-size: 38px;
    }

    .toast {
        right: 10px;
        bottom: 10px;
        max-width: calc(100vw - 20px);
    }
}

@media (max-width: 390px) {
    .brand-lockup h1 {
        max-width: 42vw;
        font-size: 13px;
    }

    .header-actions {
        gap: 5px;
    }

    .quiet-button {
        padding-inline: 7px;
    }

    .status-ribbon {
        grid-template-columns: 0.84fr 1.35fr 0.72fr;
        padding-inline: 5px;
    }

    .mobile-view-switch {
        padding-inline: 5px;
    }

    .mobile-view-switch button {
        padding-inline: 4px;
        font-size: 13px;
    }

    .game-layout {
        padding-inline: 5px;
    }

    .operations-panel,
    .damage-panel {
        padding-inline: 10px;
    }
}

/* Motion preference */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after,
body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after,
.app-shell.reduce-motion *,
.app-shell.reduce-motion *::before,
.app-shell.reduce-motion *::after,
.app-shell.reduced-motion *,
.app-shell.reduced-motion *::before,
.app-shell.reduced-motion *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
}

/* High-contrast and print fallbacks */

@media (forced-colors: active) {
    .tone-green,
    .tone-yellow,
    .tone-red,
    .tone-blue,
    .damage-panel,
    .intro-visual,
    .service-card,
    .primary-button {
        forced-color-adjust: auto;
    }

    .status-card::before,
    .live-indicator i {
        border: 2px solid currentColor;
    }
}

@media print {
    .site-header,
    .mobile-view-switch,
    .overlay,
    .toast,
    .hint-button,
    .action-button {
        display: none !important;
    }

    body,
    .app-shell {
        color: #000;
        background: #fff;
    }

    .game-chrome {
        position: static;
        background: none;
        border: 0;
        box-shadow: none;
    }

    .status-ribbon,
    .game-layout {
        display: block;
        max-width: none;
        padding: 0;
    }

    .status-ribbon > *,
    .operations-panel,
    .damage-panel {
        position: static;
        margin-bottom: 10px;
        color: #000;
        background: #fff;
        border: 1px solid #777;
        box-shadow: none;
    }
}
