@import url("https://fonts.googleapis.com/css2?family=Fira+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600&display=swap");

:root {
    --bg: #f4f1ec;
    --bg-accent: #fef9f0;
    --text: #1f1b16;
    --muted: #6b5f56;
    --primary: #1d4f5c;
    --secondary: #d4a373;
    --card: #ffffff;
    --border: #e1d7cc;
    --message-bg: #fff1e0;
    --message-border: #f0d9c2;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top, var(--bg-accent), var(--bg));
    min-height: 100vh;
    padding-bottom: 48px;
}

.container {
    width: min(100%, 960px);
    margin: 0 auto;
    padding: 24px;
}

.site-header {
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.85);
    color: var(--muted);
    font-size: 0.75rem;
    text-align: center;
    padding: 10px 16px;
    backdrop-filter: blur(8px);
    z-index: 9;
}

.site-footer a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
}

.site-footer a:hover {
    text-decoration: underline;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    font-size: 1.4rem;
    font-weight: 600;
}

nav a {
    margin-left: 16px;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
}

.tabs {
    display: flex;
    gap: 12px;
    margin: 16px 0 24px;
    flex-wrap: wrap;
}

.tab-button {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
}

.tab-button.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.tab-panel {
    display: block;
}

body.tabs-enabled .tab-panel {
    display: none;
}

body.tabs-enabled .tab-panel.active {
    display: block;
}

.hero {
    padding: 64px 0 32px;
}

.hero h1 {
    font-size: clamp(2.2rem, 3vw, 3.2rem);
    margin-bottom: 16px;
}

h1 {
    margin-top: 0;
}

.hero p {
    color: var(--muted);
    font-size: 1.1rem;
    max-width: 600px;
}

.cta {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.button {
    background: var(--primary);
    color: white;
    padding: 10px 18px;
    border-radius: 999px;
    text-decoration: none;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.button.secondary {
    background: var(--secondary);
    color: var(--text);
}

.button.danger {
    background: #8a3b3b;
    color: #f5e9e9;
}

.oauth-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.login-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

.login-actions .oauth-buttons {
    margin-left: auto;
}

.oauth-buttons-stack {
    margin-top: 10px;
}

.login-actions-group {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: max-content;
}

.oauth-buttons-stack {
    flex-direction: row;
    align-items: center;
}

.login-form .login-actions .button {
    width: 100%;
}

.gsi-material-button {
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -webkit-appearance: none;
    background-color: #ffffff;
    background-image: none;
    border: 1px solid #747775;
    border-radius: 20px;
    box-sizing: border-box;
    color: #1f1f1f;
    cursor: pointer;
    font-family: "Roboto", arial, sans-serif;
    font-size: 14px;
    height: 40px;
    letter-spacing: 0.25px;
    outline: none;
    overflow: hidden;
    padding: 0 12px;
    position: relative;
    text-align: center;
    transition: background-color 0.218s, border-color 0.218s, box-shadow 0.218s;
    vertical-align: middle;
    white-space: nowrap;
    max-width: 400px;
    min-width: min-content;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.gsi-material-button .gsi-material-button-icon {
    height: 20px;
    margin-right: 10px;
    min-width: 20px;
    width: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.gsi-material-button .gsi-material-button-icon img {
    width: 20px;
    height: 20px;
}

.gsi-material-button .gsi-material-button-content-wrapper {
    align-items: center;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    height: 100%;
    justify-content: space-between;
    position: relative;
    width: 100%;
}

.gsi-material-button .gsi-material-button-contents {
    flex-grow: 1;
    font-family: "Roboto", arial, sans-serif;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: top;
}

.gsi-material-button .gsi-material-button-state {
    transition: opacity 0.218s;
    bottom: 0;
    left: 0;
    opacity: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.gsi-material-button:disabled {
    cursor: default;
    background-color: #ffffff61;
    border-color: #1f1f1f1f;
}

.gsi-material-button:disabled .gsi-material-button-contents {
    opacity: 38%;
}

.gsi-material-button:disabled .gsi-material-button-icon {
    opacity: 38%;
}

.gsi-material-button:not(:disabled):active .gsi-material-button-state,
.gsi-material-button:not(:disabled):focus .gsi-material-button-state {
    background-color: #303030;
    opacity: 12%;
}

.gsi-material-button:not(:disabled):hover {
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.30), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.gsi-material-button:not(:disabled):hover .gsi-material-button-state {
    background-color: #303030;
    opacity: 8%;
}

.gsi-material-button.discord-button {
    background-color: #5865f2;
    border-color: #4c58d3;
    color: #ffffff;
}

.gsi-material-button.discord-button .gsi-material-button-state {
    background-color: #0f0f1f;
}

.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin: 24px 0;
    box-shadow: 0 10px 24px rgba(29, 79, 92, 0.08);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.panel-header h2 {
    margin: 0;
}

.panel h2:first-child {
    margin-top: 0;
}

.list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.list li:last-child {
    border-bottom: none;
}

.list-title {
    font-weight: 600;
}

.list-meta {
    color: var(--muted);
    font-size: 0.9rem;
}

.muted-inline {
    color: var(--muted);
    font-size: 0.85rem;
    margin-left: 6px;
}

.list-code {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f2efe9;
    border-radius: 8px;
    display: inline-block;
}

.list-message {
    margin-top: 8px;
    color: var(--muted);
}

.release-message {
    margin: 10px auto 0;
    max-width: 560px;
    text-align: center;
    padding: 8px 20px 16px;
    border-radius: 12px;
    background: var(--message-bg);
    border: 1px solid var(--message-border);
}

.release-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-bottom: 10px;
}

.release-content {
    font-size: 1.15rem;
    font-weight: 600;
    word-break: break-word;
}

.release-content.code {
    font-family: "Fira Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.session-meta {
    max-width: 560px;
    margin: 0 auto 12px;
    text-align: center;
}

.window-block {
    text-align: center;
    margin: 12px auto 0;
    color: var(--muted);
}

.window-label {
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    margin-bottom: 2px;
}

.window-times {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px auto 0;
    justify-content: center;
}

.tag-list-left {
    justify-content: flex-start;
    margin-left: 0;
    margin-right: 0;
}

.tag {
    padding: 4px 10px;
    border-radius: 999px;
    background: #1b2a46;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.list-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    font-weight: 500;
}

.toggle input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.inline-form {
    margin: 0;
}

.form {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    max-width: 480px;
}

.form-wide {
    max-width: 720px;
}

.login-form {
    display: inline-block;
    width: max-content;
    max-width: 100%;
}

.form p {
    margin: 0 0 12px;
}

.form .helptext {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.85rem;
}

.form-field {
    margin-bottom: 12px;
}

.form-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.form-field .toggle-switch {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0;
}

.form input, .form select, .form textarea,
.form-plain input, .form-plain select, .form-plain textarea {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 0;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-family: inherit;
    background: #16253f;
    color: #e2ebf9;
}

.profile-page .form-plain input,
.profile-page .form-plain select,
.profile-page .form-plain textarea {
    margin-bottom: 12px;
}

.form-error {
    color: #d16b6b;
    margin-top: 4px;
    font-size: 0.9rem;
}

.field-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-weight: 600;
}

.tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #22314b;
    color: #cfe0ff;
    font-size: 0.75rem;
    cursor: help;
    position: relative;
}

.tooltip::after {
    content: attr(aria-label);
    position: absolute;
    bottom: 140%;
    left: 50%;
    transform: translateX(-50%);
    background: #111c33;
    color: #dce7fb;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

.tooltip:hover::after,
.tooltip.is-open::after {
    opacity: 1;
}

.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0;
}

.toggle-block {
    display: flex;
    width: 100%;
    margin-bottom: 12px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.form-plain .form-actions {
    margin-top: 8px;
}

.form-actions-row {
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.form-actions-row form {
    margin: 0;
}

.section-divider {
    border: none;
    border-top: 2px solid var(--border);
    margin: 16px 0;
}

.section-divider-no-bottom {
    margin-bottom: 0;
}



.page-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.page-actions form {
    margin: 0;
}

.page-actions .button {
    min-width: 180px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 0.95rem;
    line-height: 1;
    padding: 10px 18px;
    min-height: 40px;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal.open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 10, 20, 0.7);
    backdrop-filter: blur(4px);
}

.modal-card {
    position: relative;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    max-width: 420px;
    width: calc(100% - 48px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.modal-card h2 {
    margin-top: 0;
}

.action-list {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.modal-actions {
    margin-top: 12px;
}

.modal-divider {
    border: none;
    border-top: 2px solid var(--border);
    margin: 14px 0 10px;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.toggle-visual {
    position: relative;
    display: inline-block;
    width: 80px;
    height: 40px;
    flex-shrink: 0;
}

.toggle-switch-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 80px;
    height: 40px;
    background-color: #2a3856;
    border-radius: 20px;
    box-shadow: inset 0 0 0 2px #22314b;
    transition: background-color 0.3s ease-in-out;
}

.toggle-switch-handle {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 30px;
    height: 30px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease-in-out;
}

.toggle-switch input[type="checkbox"]:checked ~ .toggle-visual .toggle-switch-handle {
    transform: translateX(40px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2), 0 0 0 3px #2f74b8;
}

.toggle-switch input[type="checkbox"]:checked ~ .toggle-visual .toggle-switch-background {
    background-color: #2f74b8;
    box-shadow: inset 0 0 0 2px #26639a;
}

.toggle-switch.toggle-danger input[type="checkbox"]:checked ~ .toggle-visual .toggle-switch-background {
    background-color: #8a3b3b;
    box-shadow: inset 0 0 0 2px #6f2f2f;
}

.toggle-switch.toggle-danger input[type="checkbox"]:checked ~ .toggle-visual .toggle-switch-handle {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2), 0 0 0 3px #8a3b3b;
}

.toggle-text {
    font-weight: 600;
    line-height: 1.2;
    align-self: center;
}

.toggle-switch .toggle-switch-background,
.toggle-switch .toggle-switch-handle {
    pointer-events: none;
}

.panel form + form {
    margin-top: 12px;
}

.form-help {
    margin-top: 12px;
    color: var(--muted);
}

.messages {
    margin: 16px 0;
}

.message {
    background: var(--message-bg);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--message-border);
}

@media (max-width: 720px) {
    nav a {
        margin-left: 8px;
    }

    .site-header .container {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0a1324;
        --bg-accent: #0f1b33;
        --text: #e2ebf9;
        --muted: #9ab0d1;
        --primary: #3a7bbd;
        --secondary: #2b5e8e;
        --card: #121e36;
        --border: #1f2c47;
        --message-bg: #1b2a46;
        --message-border: #2a3e60;
    }

    body {
        background: radial-gradient(circle at top, var(--bg-accent), var(--bg));
    }

    .site-header {
        background: rgba(10, 19, 36, 0.9);
        border-bottom: 1px solid var(--border);
    }

    .site-footer {
        background: rgba(10, 19, 36, 0.9);
        border-top: 1px solid var(--border);
    }

    nav a {
        color: var(--text);
    }

    .list-code {
        background: #16233d;
    }
}
