html, body {
    margin: 0;
    padding: 0;
    background: #0d0d0f;
    color: #eee;
    font-family: system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

:focus-visible {
    outline: 2px solid #43b581;
    outline-offset: 2px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    gap: 16px;
}

.topbar a {
    color: #aaa;
    text-decoration: none;
    font-size: 0.9rem;
}

.topbar a:hover {
    color: #fff;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.contact-btn {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #2a2a2e;
    color: #ccc !important;
    text-decoration: none;
    white-space: nowrap;
}

.contact-btn:hover {
    border-color: #43b581;
    color: #fff !important;
}

.status {
    font-size: 0.9rem;
    color: #ddd;
}

.status a {
    margin-left: 12px;
    cursor: pointer;
}

.status-badge {
    font-size: 0.85rem;
    color: #666;
}

.login-link {
    color: #5865F2 !important;
    font-weight: 600;
}

.login-link:hover {
    color: #4752c4 !important;
}

.lang-switch {
    display: flex;
    gap: 4px;
}

.lang-switch a {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid #2a2a2e;
    color: #888;
}

.lang-switch a.active {
    color: #eee;
    border-color: #43b581;
}

.notice-wrap {
    padding: 0 20px;
}

.notice {
    max-width: 1100px;
    margin: 6px auto 0;
    padding: 12px 16px;
    border: 1px solid rgba(222, 156, 47, 0.5);
    background: rgba(222, 156, 47, 0.08);
    border-radius: 12px;
    color: rgb(232, 190, 110);
    font-size: 0.85rem;
    line-height: 1.45;
}

.notice strong {
    color: rgb(222, 156, 47);
}

.hero {
    text-align: center;
    padding: 22px 20px 6px;
}

.hero h1 {
    margin: 0 0 8px;
    font-size: 1.8rem;
}

.hero p {
    margin: 0;
    color: #999;
}

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 20px 160px;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 28px;
    align-items: start;
}

.stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.wheel-wrap {
    position: relative;
    width: 100%;
    max-width: 560px;
    aspect-ratio: 1;
}

.wheel-wrap canvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #2a2a2e, 0 10px 50px rgba(0, 0, 0, 0.6), 0 0 80px rgba(222, 156, 47, 0.07);
}

.pointer {
    position: absolute;
    top: -14px;
    left: 50%;
    width: 0;
    height: 0;
    transform: translateX(-50%);
    transform-origin: 50% 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 32px solid rgb(222, 156, 47);
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.6));
    z-index: 2;
}

.hub {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #0d0d0f;
    border: 3px solid rgb(222, 156, 47);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: clamp(0.8rem, 2.4vw, 1.3rem);
    color: rgb(222, 156, 47);
    pointer-events: none;
    z-index: 1;
}

.status-line {
    margin: 0;
    min-height: 1.4em;
    font-size: 0.95rem;
    color: #ccc;
    text-align: center;
}

.status-line strong {
    color: rgb(222, 156, 47);
}

.sound-btn {
    background: #1a1a1e;
    border: 1px solid #2a2a2e;
    color: #999;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.sound-btn:hover {
    border-color: #43b581;
    color: #ddd;
}

.sound-btn.active {
    border-color: #43b581;
    color: #43b581;
    background: rgba(67, 181, 129, 0.12);
}

.spin-btn {
    background: #43b581;
    color: #0d0d0f;
    border: 0;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.1rem;
    padding: 14px 44px;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.1s ease;
}

.spin-btn:hover:not(:disabled) {
    filter: brightness(1.1);
}

.spin-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.spin-btn:disabled {
    background: #26262b;
    color: #666;
    cursor: not-allowed;
}

.panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stat {
    background: #1a1a1e;
    border: 1px solid #2a2a2e;
    border-radius: 12px;
    padding: 12px 14px;
}

.stat-label {
    font-size: 0.76rem;
    color: #888;
    margin: 0 0 4px;
}

.stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    overflow-wrap: anywhere;
}

.stat-value.gold {
    color: rgb(222, 156, 47);
}

.stat-value.green {
    color: #43b581;
}

.stat-sub {
    font-size: 0.74rem;
    color: #777;
    margin: 3px 0 0;
}

.box {
    background: #1a1a1e;
    border: 1px solid #2a2a2e;
    border-radius: 12px;
    padding: 14px 16px;
}

.box h2 {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 700;
}

.box-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.box-head h2 {
    margin: 0;
}

.link-btn {
    background: none;
    border: 0;
    color: #888;
    font-size: 0.76rem;
    cursor: pointer;
    padding: 2px 4px;
}

.link-btn:hover:not(:disabled) {
    color: #eee;
}

.link-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.rules {
    margin: 0;
    padding-left: 18px;
    color: #aaa;
    font-size: 0.82rem;
    line-height: 1.6;
}

.empty-note {
    margin: 0;
    color: #666;
    font-size: 0.82rem;
}

.nick-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nick-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #14141a;
    border: 1px solid #222;
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 0.82rem;
}

.nick-list li.winner {
    border-color: rgb(222, 156, 47);
    color: rgb(222, 156, 47);
}

.nick-list .nick-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nick-list button {
    background: none;
    border: 0;
    color: #666;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 2px 6px;
}

.nick-list button:hover:not(:disabled) {
    color: #ed4245;
}

.nick-list button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.history {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.82rem;
}

.history li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #ccc;
}

.history .history-time {
    color: #777;
    white-space: nowrap;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.field label {
    font-size: 0.76rem;
    color: #888;
}

.field input[type="text"],
.field input[type="number"],
.field input[type="datetime-local"],
.field textarea {
    width: 100%;
    background: #0d0d0f;
    border: 1px solid #2a2a2e;
    border-radius: 8px;
    color: #eee;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    color-scheme: dark;
}

.field textarea {
    min-height: 84px;
    resize: vertical;
}

.field input:focus,
.field textarea:focus {
    border-color: #43b581;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 10px;
    cursor: pointer;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn {
    background: #26262b;
    border: 1px solid #2a2a2e;
    color: #ddd;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.btn:hover:not(:disabled) {
    border-color: #43b581;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary {
    background: #43b581;
    border-color: #43b581;
    color: #0d0d0f;
}

.btn-danger:hover:not(:disabled) {
    border-color: #ed4245;
    color: #ed4245;
}

.msg {
    margin: 0;
    min-height: 1.3em;
    font-size: 0.82rem;
}

.msg.ok {
    color: #43b581;
}

.msg.err {
    color: #ed4245;
}

.gate {
    max-width: 460px;
    margin: 60px auto;
    padding: 0 20px;
    text-align: center;
}

.gate h1 {
    font-size: 1.4rem;
    margin: 0 0 10px;
}

.gate p {
    color: #999;
    line-height: 1.5;
}

.gate .btn {
    display: inline-block;
    text-decoration: none;
    margin-top: 10px;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 60;
    padding: 20px;
}

.overlay.open {
    display: flex;
}

.winner-card {
    background: #1a1a1e;
    border: 1px solid rgb(222, 156, 47);
    border-radius: 16px;
    padding: 28px 32px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 0 60px rgba(222, 156, 47, 0.2);
}

.winner-card p {
    margin: 0;
}

.winner-small {
    color: #999;
    font-size: 0.85rem;
}

.winner-name {
    font-size: 1.9rem;
    font-weight: 800;
    color: rgb(222, 156, 47);
    margin: 8px 0 14px !important;
    word-break: break-word;
}

.winner-prize {
    color: #ccc;
    font-size: 0.9rem;
}

.winner-demo {
    color: #777;
    font-size: 0.76rem;
    margin-top: 14px !important;
}

.winner-close {
    margin-top: 18px;
    background: #43b581;
    color: #0d0d0f;
    border: 0;
    border-radius: 10px;
    font-weight: 700;
    padding: 10px 28px;
    cursor: pointer;
}

.winner-close:hover {
    filter: brightness(1.1);
}

.confetti {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 70;
}

.support-widget-box {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 300px;
    z-index: 40;
    background: #1a1a1e;
    border: 1px solid #2a2a2e;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.support-widget-collapsed-view {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
}

.support-widget-collapsed-view p {
    margin: 0;
    font-size: 0.8rem;
    color: #ccc;
    line-height: 1.3;
    flex: 1;
}

.support-widget-btn {
    background: #43b581;
    color: #0d0d0f !important;
    font-weight: 700;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.support-widget-btn:hover {
    filter: brightness(1.1);
}

.support-widget-toggle {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 4px;
    flex-shrink: 0;
}

.support-widget-toggle:hover {
    color: #eee;
}

.support-widget-expanded-view {
    position: relative;
}

.support-widget-toggle-inline {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 1;
    background: rgba(13, 13, 15, 0.7);
    border-radius: 6px;
}

.support-widget-frame {
    width: 100%;
    height: 450px;
    border: 0;
    display: block;
}

.support-widget-box.collapsed .support-widget-expanded-view {
    display: none;
}

.support-widget-box:not(.collapsed) .support-widget-collapsed-view {
    display: none;
}

@media (max-width: 900px) {
    .page {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .support-widget-box {
        left: 10px;
        right: 10px;
        width: auto;
    }

    .topbar {
        flex-wrap: wrap;
    }
}

.input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-row input {
    flex: 1;
    min-width: 0;
}

.unit-suffix {
    color: #888;
    font-size: 0.85rem;
}

.unit-switch {
    display: inline-flex;
    flex-shrink: 0;
    border: 1px solid #2a2a2e;
    border-radius: 8px;
    overflow: hidden;
}

.unit-switch button {
    background: #0d0d0f;
    border: 0;
    color: #888;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.unit-switch button.active {
    background: rgba(67, 181, 129, 0.18);
    color: #43b581;
}

.kv {
    margin: 16px 0 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
}

.kv div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.kv dt {
    color: #888;
}

.kv dd {
    margin: 0;
    font-weight: 700;
}

.kv .kv-total dd {
    color: rgb(222, 156, 47);
}

.hint {
    margin: 8px 0 0;
    font-size: 0.74rem;
    color: #777;
    line-height: 1.4;
}