:root {
  color-scheme: dark;
  font-family: Inter, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  color: #edf2ff;
  background: #101827;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at top, #1c2c49 0, #101827 55%);
}
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.page { width: min(100% - 32px, 620px); margin: 0 auto; padding: 48px 0 28px; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.mark { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 16px; background: #9de6c1; color: #10251c; font-size: 29px; font-weight: 900; }
.eyebrow { margin: 0 0 7px; color: #92a4c3; font-size: 11px; font-weight: 800; letter-spacing: .15em; }
h1 { margin: 0; font-size: 27px; letter-spacing: -.04em; }
.panel { padding: 25px; border: 1px solid #2c3b55; border-radius: 20px; background: rgba(22, 33, 51, .94); box-shadow: 0 20px 60px rgba(0, 0, 0, .2); }
.intro { margin: 0 0 24px; color: #bdc8db; line-height: 1.7; }
.field-label { display: block; margin: 0 0 8px; color: #cbd5e5; font-size: 13px; font-weight: 700; }
.text-input { width: 100%; min-width: 0; padding: 13px 14px; border: 1px solid #3a4b68; border-radius: 11px; outline: none; background: #111c2c; color: #f4f7ff; }
.text-input:focus { border-color: #9de6c1; box-shadow: 0 0 0 3px rgba(157, 230, 193, .13); }
.text-input::placeholder { color: #73829a; }
.lobby-actions { display: grid; gap: 10px; margin-top: 18px; }
.identity-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 14px; }
.identity-actions #login-button { grid-column: 1 / -1; }
.identity-badge { margin: 0 0 16px; color: #9de6c1; font-size: 13px; font-weight: 800; }
.profile-card { display: flex; align-items: center; gap: 10px; width: min(245px, 48vw); padding: 8px 11px; border: 1px solid #34455f; border-radius: 14px; background: #162338; color: #edf2ff; text-align: left; }
.profile-card:hover { border-color: #9de6c1; }
.profile-card-avatar-wrap { position: relative; display: grid; flex: 0 0 42px; place-items: center; width: 42px; height: 42px; overflow: hidden; border: 1px solid #50617b; border-radius: 50%; background: #263751; }
.profile-card-avatar { width: 100%; height: 100%; object-fit: cover; }
.profile-card-info { display: grid; min-width: 0; flex: 1; gap: 3px; }
.profile-card-nickname { overflow: hidden; font-size: 12px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.profile-card-level { color: #9de6c1; font-size: 10px; }
.profile-card-progress { width: 100%; height: 5px; accent-color: #9de6c1; }
.name-gradient { color: transparent !important; background-image: linear-gradient(100deg, var(--name-color), var(--name-color2), var(--name-color)); background-size: 220% auto; background-clip: text; -webkit-background-clip: text; }
.name-gradient-animated { animation: nickname-shimmer 3.5s linear infinite; }
@keyframes nickname-shimmer { to { background-position: 220% center; } }
@media (prefers-reduced-motion: reduce) { .name-gradient-animated { animation: none; } }
.public-rooms-section { margin-top: 20px; padding-top: 4px; }
.explorer-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.explorer-heading .eyebrow { margin-bottom: 5px; }
.public-rooms-section h2 { margin: 0; font-size: 20px; }
.explorer-help { margin: 12px 0 16px; }
.public-rooms { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.public-room { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid #34455f; border-radius: 11px; background: #111c2c; }
.public-room-info { min-width: 0; }
.public-room-name { display: block; overflow: hidden; color: #edf2ff; font-size: 13px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.public-room-count { display: block; margin-top: 5px; color: #8291a8; font-size: 11px; }
.room-dialog { width: min(calc(100% - 28px), 440px); max-width: none; max-height: calc(100vh - 24px); overflow-y: auto; padding: 0; border: 1px solid #3a4b68; border-radius: 18px; background: #162133; color: #edf2ff; box-shadow: 0 24px 80px rgba(0, 0, 0, .5); }
.room-dialog::backdrop { background: rgba(4, 9, 17, .76); backdrop-filter: blur(4px); }
.room-dialog-card { padding: 25px; }
.room-dialog-card h2 { margin: 0 0 20px; font-size: 22px; }
.dialog-label { margin-top: 16px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.form-message { min-height: 20px; margin: 12px 0 0; color: #ffcf8a; font-size: 12px; line-height: 1.6; }
.profile-dialog { width: min(calc(100% - 28px), 560px); }
.profile-detail-heading { display: flex; align-items: center; gap: 15px; margin-bottom: 17px; }
.profile-detail-avatar { display: grid; flex: 0 0 76px; place-items: center; width: 76px; height: 76px; border: 1px solid #50617b; border-radius: 50%; background: #263751; color: #9de6c1; object-fit: cover; }
.profile-detail-heading h2 { margin: 0 0 8px; font-size: 22px; overflow-wrap: anywhere; }
.profile-nickname { margin: 0; font-weight: 900; }
.account-profile { padding: 16px; border: 1px solid #34455f; border-radius: 13px; background: #111c2c; }
.profile-level { margin: 0; color: #9de6c1; font-size: 14px; font-weight: 900; }
.profile-progress { display: block; width: 100%; height: 11px; accent-color: #9de6c1; }
.profile-xp { margin: 8px 0 14px; }
.profile-bio { margin: 0 0 16px; color: #b9c6d9; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.profile-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.profile-stats div { display: grid; gap: 4px; padding: 10px 4px; border-radius: 10px; background: #1a2940; text-align: center; }
.profile-stats strong { color: #edf2ff; font-size: 16px; }
.profile-stats span { color: #8291a8; font-size: 10px; }
.friends-panel { margin-top: 18px; padding-top: 15px; border-top: 1px solid #2c3b55; }
.friends-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.friends-heading h3 { margin: 0; font-size: 14px; }
.friend-count { display: grid; min-width: 20px; height: 20px; place-items: center; border-radius: 999px; background: #2c3d59; color: #9de6c1; font-size: 10px; font-weight: 800; }
.friend-form { display: flex; gap: 8px; }
.friend-form .text-input { padding: 9px 11px; font-size: 12px; }
.friend-form .button { flex: 0 0 auto; }
.friend-list-wrap { margin-top: 13px; }
.friend-list-wrap h4 { margin: 0 0 7px; color: #92a4c3; font-size: 11px; }
.friend-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.friend-item { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 8px; border: 1px solid #2c3b55; border-radius: 9px; color: #dbe5f5; font-size: 12px; }
.friend-avatar { width: 26px; height: 26px; border-radius: 50%; background: #263751; object-fit: cover; }
.friend-item-name { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.friend-item .button { padding: 6px 8px; font-size: 10px; }
.avatar-edit-row { display: flex; align-items: center; gap: 14px; }
.file-button { display: inline-block; }
.avatar-help { margin-top: 8px; }
.support-panel, .admin-panel { margin-top: 18px; padding-top: 15px; border-top: 1px solid #2c3b55; }
.support-panel h3, .admin-heading h3 { margin: 0 0 10px; font-size: 14px; }
.inquiry-form { display: grid; gap: 8px; }
.inquiry-form .field-label { margin: 0; }
.inquiry-form .form-message, .name-style-form .form-message { margin: 2px 0; }
.admin-heading, .admin-inquiries-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.admin-badge { padding: 4px 7px; border-radius: 99px; background: #493f21; color: #ffe18a; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.name-style-form { display: grid; gap: 8px; padding: 12px; border: 1px solid #34455f; border-radius: 11px; background: #111c2c; }
.name-style-form h4, .admin-inquiries h4 { margin: 0; font-size: 12px; }
.name-style-form .field-label { margin: 0; }
.style-color-row { display: flex; gap: 16px; }
.style-color-row .field-label { display: grid; gap: 6px; }
.style-color-row input[type="color"] { width: 54px; height: 34px; padding: 2px; border: 1px solid #50617b; border-radius: 7px; background: transparent; }
.style-animation { display: flex; align-items: center; gap: 7px; color: #b9c6d9; font-size: 12px; }
.admin-inquiries { margin-top: 15px; }
.admin-inquiries-heading { margin-bottom: 8px; }
.admin-inquiry-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.admin-inquiry { padding: 10px; border: 1px solid #34455f; border-radius: 9px; background: #111c2c; }
.admin-inquiry-meta { display: flex; justify-content: space-between; gap: 8px; color: #9de6c1; font-size: 10px; }
.admin-inquiry-date { color: #8291a8; text-align: right; }
.admin-inquiry-content { margin: 8px 0 0; color: #dbe5f5; font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.crop-dialog { width: min(calc(100% - 28px), 460px); }
.crop-workspace { display: grid; place-items: center; margin: 6px 0 18px; }
#avatar-crop-canvas { display: block; width: min(100%, 320px); aspect-ratio: 1; border-radius: 50%; background: #111c2c; touch-action: none; cursor: grab; }
#avatar-crop-canvas:active { cursor: grabbing; }
.crop-zoom { display: block; width: 100%; accent-color: #9de6c1; }
.crop-hint { margin-top: 8px; }
.bio-input { resize: vertical; min-height: 90px; line-height: 1.5; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.delete-warning { margin: 0 0 18px; color: #ffb7b7; font-size: 13px; line-height: 1.6; }
.guest-profile { padding: 14px; border: 1px solid #34455f; border-radius: 12px; background: #111c2c; }
.join-box { padding-top: 18px; border-top: 1px solid #2c3b55; }
.join-row, .guess-row { display: flex; gap: 10px; }
.join-row .button, .guess-row .button { flex: 0 0 auto; }
.code-input { text-transform: uppercase; letter-spacing: .12em; }
.button { border: 0; border-radius: 11px; padding: 13px 17px; font-weight: 800; transition: transform .12s ease, filter .12s ease; }
.button:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button-primary { background: #9de6c1; color: #10251c; }
.button-secondary { background: #2c3d59; color: #e7eefb; }
.button-danger { background: #8d3d4a; color: #fff0f1; }
.button-small { padding: 8px 11px; background: #293a54; color: #dbe5f5; font-size: 12px; }
.button-quiet { padding: 9px 12px; background: transparent; color: #a8b6ca; font-size: 13px; }
.helper { margin: 15px 0 0; color: #8291a8; font-size: 12px; line-height: 1.6; }
.game-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid #2c3b55; }
.room-name { max-width: 260px; overflow: hidden; margin: 0 0 12px; color: #edf2ff; font-size: 16px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.room-code-row { display: flex; align-items: center; gap: 10px; }
.room-code { color: #9de6c1; font-size: 22px; letter-spacing: .18em; }
.status { min-height: 25px; margin: 18px 0; color: #d4def0; font-weight: 700; }
.status-win { color: #9de6c1; font-size: 21px; }
.status-loss { color: #ffadad; font-size: 21px; }
.players { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.player-chip { padding: 8px 11px; border: 1px solid #34455f; border-radius: 999px; color: #b9c6d9; font-size: 12px; }
.player-chip.active { border-color: #9de6c1; color: #b7f0d1; background: rgba(157, 230, 193, .08); }
.range-card { padding: 19px; border: 1px solid #334763; border-radius: 15px; background: #121f32; text-align: center; }
.range-card .eyebrow { margin-bottom: 8px; }
.range { margin: 0; font-size: clamp(42px, 11vw, 58px); font-weight: 900; letter-spacing: .04em; }
.range span { color: #71849f; font-size: .58em; }
.turn-notice { min-height: 24px; margin: 17px 0; color: #9de6c1; text-align: center; font-weight: 700; }
.guess-input { text-align: center; font-size: 18px; font-weight: 700; }
.guess-form .button { min-width: 85px; }
.history-section { margin-top: 25px; }
.history-section h2 { margin: 0 0 12px; font-size: 14px; }
.history { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.history li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 9px; background: #111c2c; color: #bfcadd; font-size: 13px; }
.history .result { color: #91a2bc; }
.history .result.target { color: #ffadad; font-weight: 800; }
.full-button { width: 100%; margin-top: 18px; }
.start-game-hint { margin-top: 8px; text-align: center; }
.message { min-height: 22px; margin: 14px 2px 0; color: #ffcf8a; font-size: 13px; }
footer { display: grid; justify-items: center; gap: 12px; margin-top: 22px; color: #63738a; font-size: 11px; text-align: center; }

@media (max-width: 480px) {
  .page { width: min(100% - 22px, 620px); padding-top: 28px; }
  .panel { padding: 19px; }
  .join-row, .guess-row { gap: 8px; }
  .button { padding: 12px 13px; }
  .site-header { align-items: flex-start; }
  .brand { gap: 9px; }
  .mark { width: 42px; height: 42px; }
  .profile-card { width: 150px; gap: 7px; padding: 7px; }
  .profile-card-avatar-wrap { flex-basis: 34px; width: 34px; height: 34px; }
  .profile-stats { gap: 5px; }
  .profile-stats strong { font-size: 14px; }
  .profile-stats span { font-size: 9px; }
  .dialog-actions { flex-wrap: wrap; }
}
