* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #fafafa;
    padding: 16px;
    overflow-x: hidden;
    touch-action: manipulation;
    color: #333;
}

a { color: #4a9; text-decoration: none; transition: color 0.2s ease; }
a:hover { color: #3a8; text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

.game-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #ffffff;
    border: 1px solid #ececec;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.04);
    max-width: 900px;
    width: 100%;
}

h1 {
    color: #2d3748;
    margin-bottom: 16px;
    text-align: center;
    font-size: clamp(1.5rem, 5vw, 2.1rem);
    font-weight: 700;
    letter-spacing: 0.3px;
}

.sound-control {
    position: fixed;
    top: 14px;
    right: 14px;
    background: #ffffff;
    border: 1px solid #ececec;
    cursor: pointer;
    color: #555;
    z-index: 100;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s;
}

.sound-control:hover { color: #4a9; border-color: #4a9; }

.title-snake { vertical-align: middle; }
.title-snake-flip { transform: scaleX(-1); vertical-align: middle; }
.overlay-snake-icon { margin-bottom: 10px; }

.online-dot-sm {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ecc71;
    vertical-align: middle;
    margin-right: 4px;
}

.online-indicator {
    position: fixed;
    top: 14px;
    left: 14px;
    font-size: 0.78rem;
    color: #666;
    z-index: 100;
    background: #ffffff;
    padding: 7px 12px;
    border-radius: 50px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #ececec;
    font-weight: 500;
}

.online-indicator strong { color: #2ecc71; font-weight: 700; }

.user-badge {
    position: fixed;
    top: 14px;
    right: 145px;
    font-size: 0.78rem;
    color: #4a9;
    z-index: 100;
    background: #ffffff;
    padding: 7px 12px;
    border-radius: 50px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #ececec;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.user-badge:empty { display: none; }

.btn-pink {
    background: #4a9;
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    letter-spacing: 0.3px;
}

.btn-pink:hover {
    background: #3a8a6a;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.btn-pink:active { transform: translateY(1px); }

.btn-blue {
    background: #ffffff;
    color: #4a9;
    border: 1px solid #4a9;
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.btn-blue:hover { background: #f0f9f5; }
.btn-blue:active { transform: translateY(1px); }

.btn-gray {
    background: #ffffff;
    color: #666;
    border: 1px solid #ddd;
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-gray:hover { background: #f7f7f7; border-color: #bbb; }
.btn-gray:active { transform: translateY(1px); }

.btn-block { display: block; width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 0.78rem; }

.btn-back {
    background: #ffffff;
    color: #4a9;
    border: 1px solid #4a9;
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-back:hover { background: #f0f9f5; }

.text-field {
    width: 100%;
    padding: 11px 16px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    color: #333;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
    margin-bottom: 10px;
}

.text-field:focus { border-color: #4a9; box-shadow: 0 0 0 3px rgba(74,153,153,0.1); }
.text-field::placeholder { color: #bbb; }

.copyright-section {
    position: relative;
    z-index: 1;
    margin-top: 18px;
    text-align: center;
    color: #aaa;
    font-size: clamp(0.72rem, 1.8vw, 0.82rem);
    line-height: 1.6;
    padding: 8px 0;
    width: 100%;
    max-width: 900px;
}
