/* Base layout — theme tokens on body[data-theme] */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    line-height: 1.45;
    transition: background 0.25s ease, color 0.25s ease;
}

.page-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 12px 14px 28px;
}

.shout-header {
    margin-bottom: 10px;
}

.shout-title {
    margin: 0 0 4px;
    font-size: 1.35rem;
    letter-spacing: 0.02em;
}

.shout-tagline {
    margin: 0 0 10px;
    opacity: 0.85;
}

.theme-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.theme-label {
    font-weight: bold;
    margin-right: 4px;
}

.theme-btn {
    cursor: pointer;
    border: 1px solid transparent;
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 3px;
}

.theme-btn.is-active {
    font-weight: bold;
    text-decoration: underline;
}

.online-panel {
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 4px;
}

.online-title {
    margin: 0 0 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.online-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.online-list li {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
}

.shoutbox-chrome {
    border-radius: 4px;
    overflow: hidden;
}

.shoutbox-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-weight: bold;
    font-size: 12px;
}

.bar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-pill {
    margin-left: auto;
    font-size: 10px;
    font-weight: normal;
    padding: 2px 6px;
    border-radius: 3px;
}

.message-stream {
    height: 320px;
    overflow-y: auto;
    padding: 8px 10px;
    scroll-behavior: smooth;
}

.message-stream.is-flash {
    animation: stream-flash 0.6s ease;
}

@keyframes stream-flash {
    0%, 100% { filter: none; }
    50% { filter: brightness(1.15); }
}

.shout {
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px dotted transparent;
}

.shout:last-child {
    border-bottom: none;
}

.shout-meta {
    font-size: 11px;
    margin-bottom: 2px;
}

.shout-meta .author {
    font-weight: bold;
    cursor: pointer;
}

.shout-meta .time {
    opacity: 0.75;
    margin-left: 6px;
}

.shout-body {
    word-wrap: break-word;
}

.shout.highlight-user {
    outline: 2px solid;
    outline-offset: 2px;
    border-radius: 3px;
}

.mention {
    font-weight: bold;
    text-decoration: none;
}

.mention:hover {
    text-decoration: underline;
}

.bb-quote {
    margin: 4px 0;
    padding: 6px 8px;
    border-left: 3px solid;
}

.bb-quote cite {
    display: block;
    font-size: 10px;
    font-style: normal;
    margin-bottom: 4px;
    opacity: 0.85;
}

.bb-code,
.bb-pre {
    overflow-x: auto;
    padding: 6px 8px;
    font-family: "Courier New", Courier, monospace;
    font-size: 12px;
}

.bb-img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

.bb-center {
    text-align: center;
}

.bb-u {
    text-decoration: underline;
}

.bb-s {
    text-decoration: line-through;
}

.bb-list {
    margin: 4px 0 4px 18px;
    padding: 0;
}

.bb-spoiler summary {
    cursor: pointer;
    font-weight: bold;
}

.flash-banner {
    text-align: center;
    padding: 4px;
    font-size: 11px;
    font-weight: bold;
}

.shout-form {
    padding: 10px;
}

.form-row {
    margin-bottom: 8px;
}

.form-row label {
    display: block;
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 3px;
}

.form-row input,
.form-row textarea {
    width: 100%;
    padding: 6px 8px;
    font: inherit;
    border-radius: 3px;
}

.guest-hint {
    display: block;
    font-size: 10px;
    margin-top: 3px;
    opacity: 0.8;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.toolbar button {
    min-width: 32px;
    padding: 3px 6px;
    font-size: 11px;
    cursor: pointer;
    border-radius: 2px;
}

.char-count {
    float: right;
    font-size: 10px;
    opacity: 0.7;
}

.form-actions {
    clear: both;
}

.btn-shout {
    cursor: pointer;
    padding: 6px 18px;
    font-weight: bold;
    border-radius: 3px;
}

.form-error {
    color: #c00;
    margin: 6px 0 0;
    font-size: 11px;
}

.site-footer {
    margin-top: 16px;
    text-align: center;
    font-size: 11px;
    opacity: 0.9;
}

.site-footer a {
    color: inherit;
}

.linkish {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
}

.about-panel {
    margin-top: 8px;
    padding: 10px;
    text-align: left;
    border-radius: 4px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

/* ——— Theme: AnimeHistory (default) ——— */
body[data-theme="animehistory"] {
    background: #242424;
    color: #d8d8d8;
}

body[data-theme="animehistory"] .shout-title {
    color: #5b8dd9;
}

body[data-theme="animehistory"] .shout-tagline {
    color: #b0b0b0;
}

body[data-theme="animehistory"] a {
    color: #5b8dd9;
}

body[data-theme="animehistory"] .theme-btn {
    background: #111;
    border-color: #3a3a3a;
    color: #c8c8c8;
}

body[data-theme="animehistory"] .theme-btn.is-active {
    border-color: #e8a87c;
    color: #e8a87c;
}

body[data-theme="animehistory"] .online-panel {
    background: #111;
    border: 1px solid #333;
}

body[data-theme="animehistory"] .online-title {
    color: #e8a87c;
}

body[data-theme="animehistory"] .online-list li {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    color: #d8d8d8;
}

body[data-theme="animehistory"] .shoutbox-chrome {
    border: 1px solid #333;
    background: #2a2a2a;
}

body[data-theme="animehistory"] .shoutbox-bar {
    background: #111;
    color: #e8e8e8;
    border-bottom: 1px solid #333;
}

body[data-theme="animehistory"] .bar-dot {
    background: #e8a87c;
}

body[data-theme="animehistory"] .status-pill {
    background: #333;
    color: #b0b0b0;
}

body[data-theme="animehistory"] .message-stream {
    background: #242424;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
}

body[data-theme="animehistory"] .shout {
    border-bottom-color: #333;
}

body[data-theme="animehistory"] .shout-meta .author {
    color: #5b8dd9;
}

body[data-theme="animehistory"] .mention {
    color: #e8a87c;
}

body[data-theme="animehistory"] .shout.highlight-user {
    outline-color: #e8a87c;
}

body[data-theme="animehistory"] .bb-quote {
    background: #1a1a1a;
    border-color: #5b8dd9;
}

body[data-theme="animehistory"] .bb-code,
body[data-theme="animehistory"] .bb-pre {
    background: #111;
    border: 1px solid #333;
}

body[data-theme="animehistory"] .flash-banner {
    background: #111;
    color: #e8a87c;
}

body[data-theme="animehistory"] .form-row label {
    color: #c8c8c8;
}

body[data-theme="animehistory"] .form-row input,
body[data-theme="animehistory"] .form-row textarea {
    background: #111;
    color: #e8e8e8;
    border: 1px solid #444;
}

body[data-theme="animehistory"] .toolbar button {
    background: #333;
    border: 1px solid #444;
    color: #d8d8d8;
}

body[data-theme="animehistory"] .toolbar button:hover {
    border-color: #5b8dd9;
}

body[data-theme="animehistory"] .btn-shout {
    background: #5b8dd9;
    color: #111;
    border: 1px solid #4a7bc4;
}

body[data-theme="animehistory"] .btn-shout:hover {
    background: #6a9ae8;
}

body[data-theme="animehistory"] .about-panel {
    background: #111;
    border: 1px solid #333;
}

body[data-theme="animehistory"] .site-footer a {
    color: #5b8dd9;
}

body[data-theme="animehistory"] .linkish {
    color: #5b8dd9;
}

/* ——— Theme: Classic phpBB ——— */
body[data-theme="classic-phpbb"] {
    background: #e8e8e8;
    color: #222;
}

body[data-theme="classic-phpbb"] .shout-title {
    color: #10417c;
}

body[data-theme="classic-phpbb"] .theme-btn {
    background: #d9e4f2;
    border-color: #8fafcf;
    color: #10417c;
}

body[data-theme="classic-phpbb"] .online-panel {
    background: #f4f7fb;
    border: 1px solid #b5c9e2;
}

body[data-theme="classic-phpbb"] .online-list li {
    background: #dce8f5;
    border: 1px solid #b5c9e2;
}

body[data-theme="classic-phpbb"] .shoutbox-chrome {
    border: 1px solid #8fafcf;
    background: #fff;
}

body[data-theme="classic-phpbb"] .shoutbox-bar {
    background: linear-gradient(#5a8ec9, #3d6ea8);
    color: #fff;
}

body[data-theme="classic-phpbb"] .bar-dot {
    background: #9fd29f;
}

body[data-theme="classic-phpbb"] .status-pill {
    background: rgba(0, 0, 0, 0.2);
}

body[data-theme="classic-phpbb"] .message-stream {
    background: #fafcff;
    border-top: 1px solid #c5d6ea;
    border-bottom: 1px solid #c5d6ea;
}

body[data-theme="classic-phpbb"] .shout {
    border-bottom-color: #dde6f0;
}

body[data-theme="classic-phpbb"] .shout-meta .author {
    color: #10417c;
}

body[data-theme="classic-phpbb"] .mention {
    color: #a03030;
}

body[data-theme="classic-phpbb"] .bb-quote {
    background: #f0f4fa;
    border-color: #5a8ec9;
}

body[data-theme="classic-phpbb"] .toolbar button {
    background: #eef3fa;
    border: 1px solid #b5c9e2;
}

body[data-theme="classic-phpbb"] .btn-shout {
    background: linear-gradient(#f0f0f0, #d8d8d8);
    border: 1px solid #888;
}

body[data-theme="classic-phpbb"] .about-panel {
    background: #f4f7fb;
    border: 1px solid #b5c9e2;
}

/* ——— Theme: Dark Terminal ——— */
body[data-theme="dark-terminal"] {
    background: #0a0a0a;
    color: #33ff66;
    font-family: "Courier New", Courier, monospace;
}

body[data-theme="dark-terminal"] .shout-title,
body[data-theme="dark-terminal"] .mention,
body[data-theme="dark-terminal"] .shout-meta .author {
    color: #66ff99;
}

body[data-theme="dark-terminal"] .theme-btn {
    background: #111;
    border-color: #33ff66;
    color: #33ff66;
}

body[data-theme="dark-terminal"] .online-panel,
body[data-theme="dark-terminal"] .shoutbox-chrome {
    /* themed below */
}

body[data-theme="dark-terminal"] .online-panel {
    background: #111;
    border: 1px solid #33ff66;
}

body[data-theme="dark-terminal"] .online-list li {
    background: #0f1a0f;
    border: 1px solid #226633;
}

body[data-theme="dark-terminal"] .shoutbox-chrome {
    border: 1px solid #33ff66;
    background: #050505;
}

body[data-theme="dark-terminal"] .shoutbox-bar {
    background: #002200;
    color: #33ff66;
}

body[data-theme="dark-terminal"] .bar-dot {
    background: #33ff66;
    box-shadow: 0 0 6px #33ff66;
}

body[data-theme="dark-terminal"] .message-stream {
    background: #000;
}

body[data-theme="dark-terminal"] .shout {
    border-bottom-color: #113311;
}

body[data-theme="dark-terminal"] input,
body[data-theme="dark-terminal"] textarea,
body[data-theme="dark-terminal"] .toolbar button {
    background: #000;
    color: #33ff66;
    border: 1px solid #226633;
}

body[data-theme="dark-terminal"] .btn-shout {
    background: #002200;
    color: #33ff66;
    border: 1px solid #33ff66;
}

body[data-theme="dark-terminal"] .flash-banner {
    background: #113311;
}

body[data-theme="dark-terminal"] .about-panel {
    background: #111;
    border: 1px solid #33ff66;
}

/* ——— Theme: GeoCities Neon ——— */
body[data-theme="geocities-neon"] {
    background: #000033 url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 20h40M20 0v40' stroke='%23003366' stroke-width='1'/%3E%3C/svg%3E");
    color: #ff0;
    font-family: "Comic Sans MS", "Chalkboard SE", cursive, sans-serif;
}

body[data-theme="geocities-neon"] .shout-title {
    color: #0ff;
    text-shadow: 2px 2px #f0f;
}

body[data-theme="geocities-neon"] .theme-btn {
    background: #f0f;
    color: #000;
    border: 2px ridge #0ff;
}

body[data-theme="geocities-neon"] .online-panel {
    background: #330066;
    border: 3px double #0ff;
}

body[data-theme="geocities-neon"] .online-list li {
    background: #ff00aa;
    color: #fff;
}

body[data-theme="geocities-neon"] .shoutbox-chrome {
    border: 4px ridge #0ff;
    background: #220044;
}

body[data-theme="geocities-neon"] .shoutbox-bar {
    background: linear-gradient(90deg, #ff00aa, #ffff00, #00ffff);
    color: #000;
}

body[data-theme="geocities-neon"] .message-stream {
    background: #110022;
}

body[data-theme="geocities-neon"] .shout-meta .author {
    color: #0ff;
}

body[data-theme="geocities-neon"] .mention {
    color: #ff0;
}

body[data-theme="geocities-neon"] input,
body[data-theme="geocities-neon"] textarea,
body[data-theme="geocities-neon"] .toolbar button {
    background: #ff0;
    color: #000;
    border: 2px inset #f0f;
}

body[data-theme="geocities-neon"] .btn-shout {
    background: #0f0;
    border: 3px outset #fff;
    color: #000;
    font-weight: bold;
}

body[data-theme="geocities-neon"] .about-panel {
    background: #330066;
    border: 2px dashed #ff0;
}

/* ——— Theme: Modern Minimal ——— */
body[data-theme="modern-minimal"] {
    background: #f7f7f8;
    color: #1a1a1a;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
}

body[data-theme="modern-minimal"] .shout-title {
    font-weight: 600;
    font-size: 1.5rem;
}

body[data-theme="modern-minimal"] .theme-btn {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 999px;
}

body[data-theme="modern-minimal"] .online-panel {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
}

body[data-theme="modern-minimal"] .online-list li {
    background: #f0f0f2;
    border-radius: 999px;
}

body[data-theme="modern-minimal"] .shoutbox-chrome {
    border: 1px solid #e5e5e5;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

body[data-theme="modern-minimal"] .shoutbox-bar {
    background: #fff;
    border-bottom: 1px solid #eee;
    color: #666;
    font-weight: 500;
}

body[data-theme="modern-minimal"] .bar-dot {
    background: #34c759;
}

body[data-theme="modern-minimal"] .message-stream {
    background: #fafafa;
}

body[data-theme="modern-minimal"] .shout-meta .author {
    color: #0066cc;
}

body[data-theme="modern-minimal"] .mention {
    color: #0066cc;
}

body[data-theme="modern-minimal"] .toolbar button {
    background: #f0f0f2;
    border: none;
    border-radius: 6px;
}

body[data-theme="modern-minimal"] .btn-shout {
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 8px;
}

body[data-theme="modern-minimal"] .about-panel {
    background: #fff;
    border: 1px solid #e5e5e5;
}

@media (max-width: 520px) {
    .message-stream {
        height: 260px;
    }
}
