:root {
    --bg: #fffcf2;
    --accent: #ff4757;
    --sub-accent: #2f3542;
    --text: #2f3542;
    --card-bg: #ffffff;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    margin: 0;
    padding: 0;
}

html {
    touch-action: manipulation;
    overscroll-behavior: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

body {
    font-family: 'Zen Maru Gothic', 'Noto Sans JP', 'Noto Sans KR', 'Noto Sans SC', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
    touch-action: manipulation;
    overscroll-behavior: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.decor {
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    opacity: 0.1;
}

.decor-1 {
    width: 300px;
    height: 300px;
    background: var(--accent);
    top: -50px;
    left: -100px;
}

.decor-2 {
    width: 200px;
    height: 200px;
    background: var(--sub-accent);
    bottom: 50px;
    right: -50px;
}

.app-container {
    width: 100%;
    max-width: 440px;
}

.main-card {
    background: var(--card-bg);
    border: 4px solid var(--text);
    border-radius: 40px;
    padding: 40px 24px;
    text-align: center;
    box-shadow: 0 12px 0 var(--text);
    margin-bottom: 30px;
    position: relative;
}

header h1 {
    font-size: 28px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.title-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    flex-shrink: 0;
}

.title-icon-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.1);
}

header p {
    font-size: 15px;
    font-weight: 900;
    opacity: 0.7;
}

.hub-account-card {
    width: 100%;
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 24px;
    background: rgba(72, 66, 120, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.hub-account-label {
    color: #ffffff;
    font-weight: 900;
    font-size: 14px;
    line-height: 1.35;
    text-align: left;
    flex: 1;
}

.hub-account-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 999px;
    font-weight: 900;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    flex-shrink: 0;
}

.hub-account-action:hover {
    transform: translateY(-1px);
}

.hub-account-action.is-google {
    background: linear-gradient(180deg, #ffffff 0%, #f7f8ff 100%);
    color: #202124;
    box-shadow: 0 8px 18px rgba(53, 57, 72, 0.18);
    border: 1px solid rgba(60, 64, 67, 0.12);
}

.hub-account-action.is-mypage {
    background: linear-gradient(180deg, #ffffff 0%, #eef0ff 100%);
    color: #2a2a44;
    box-shadow: 0 8px 18px rgba(53, 57, 72, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.55);
}

.google-mark {
    display: inline-flex;
    align-items: center;
    font-family: Outfit, 'Zen Maru Gothic', sans-serif;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.google-blue { color: #4285f4; }
.google-red { color: #ea4335; }
.google-yellow { color: #fbbc05; }
.google-green { color: #34a853; }

.google-action-text {
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
}

.btn {
    font-family: inherit;
    font-weight: 950;
    font-size: 24px;
    padding: 20px;
    border-radius: 24px;
    border: 4px solid var(--text);
    cursor: pointer;
    width: 100%;
    transition: 0.1s;
    box-shadow: 0 8px 0 var(--text);
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

button {
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

a,
[role="button"] {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.btn-start {
    background: var(--sub-accent);
    color: #fff;
}

.btn:active {
    transform: translateY(4px);
    box-shadow: 0 4px 0 var(--text);
}

/* Modal UI */
.modal-overlay {
    position: absolute;
    inset: 0;
    background: #fff;
    border-radius: 36px;
    z-index: 100;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-overlay.active {
    display: flex;
}

input[type="text"] {
    width: 100%;
    max-width: 440px;
    padding: 14px;
    border-radius: 12px;
    border: 3px solid var(--text);
    font-family: inherit;
    font-size: 16px;
    /* Prevents iOS auto-zoom */
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    outline: none;
    box-sizing: border-box;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
    -webkit-touch-callout: default;
    -webkit-user-select: text;
    user-select: text;
}

input[type="text"]:focus {
    border-color: var(--accent);
}

.modal-overlay .btn {
    width: 100%;
    max-width: 440px;
    box-sizing: border-box;
}

.modal-overlay .btn-reg {
    background: var(--sub-accent);
    color: #fff;
    font-size: 16px;
    margin-bottom: 12px;
    padding: 16px;
    border-radius: 20px;
    box-shadow: 0 4px 0 var(--text);
}

.modal-overlay .btn-back-modal,
.modal-overlay .btn-back {
    background: #eee;
    color: var(--text);
    font-size: 14px;
    padding: 16px;
    border-radius: 20px;
    box-shadow: 0 4px 0 var(--text);
}

/* Ranking Section */
.ranking-section {
    width: 100%;
    max-width: 440px;
}

.ranking-card {
    background: #fff;
    border: 4px solid var(--text);
    border-radius: 40px;
    padding: 40px 24px;
    text-align: center;
    box-shadow: 0 12px 0 var(--text);
    margin-bottom: 30px;
    position: relative;
}

.ranking-card h3 {
    font-size: 24px;
    font-weight: 950;
    color: var(--text);
    margin-bottom: 8px;
    display: block;
}

.ranking-card h4 {
    font-size: 14px;
    font-weight: 900;
    color: #ffb820;
    display: inline-block;
    line-height: 1.4;
    background: #fff6de;
    padding: 6px 16px;
    border-radius: 50px;
    margin-top: 4px;
}

.ranking-list {
    list-style: none;
    margin-top: 24px;
}

.ranking-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 2px dashed #eee;
    font-weight: 700;
}

.rank-num {
    color: var(--accent);
    width: 30px;
    font-family: 'Outfit';
    font-weight: 900;
}

.rank-name {
    flex: 1;
    text-align: left;
    margin: 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex-wrap: wrap;
}

.rank-name a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rank-name img {
    display: block;
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.rank-score {
    font-family: 'Outfit';
    color: var(--sub-accent);
    font-weight: 900;
}

.ranking-item.small {
    padding: 8px 0;
    font-size: 14px;
    opacity: 0.7;
    border-bottom: 1px solid #f0f0f0;
}

.btn-more {
    font-family: inherit;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    margin-top: 15px;
    padding: 10px;
    text-decoration: underline;
    transition: opacity 0.2s;
}

.btn-more:hover {
    opacity: 0.8;
}

/* More Games & Footer */
.more-games {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    width: 100%;
}

.more-games h3 {
    font-size: 20px;
    font-weight: 950;
    margin-bottom: 4px;
    text-align: left;
}

.liquid-card {
    background: #fff;
    border: 3px solid var(--text);
    border-radius: 25px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    box-shadow: 0 4px 0 var(--text);
    color: var(--text);
    transition: transform 0.1s;
}

.liquid-card:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--text);
}

.liquid-card::after {
    content: "\2192";
    margin-left: auto;
    font-weight: 900;
    opacity: 0.2;
}

.icon-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.icon-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.1);
}

.card-info {
    flex: 1;
    text-align: left;
    display: flex;
    flex-direction: column;
}

.card-label {
    font-weight: 900;
    font-size: 16px;
    color: var(--text);
}

.card-desc {
    font-size: 12px;
    font-weight: 700;
    opacity: 0.4;
}

.hub-link {
    display: block;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    text-decoration: underline;
    margin-top: 20px;
    margin-bottom: 40px;
    opacity: 0.6;
}

/* Sound Toggle */
.sound-toggle {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 1000;
    background: #f1f2f6;
    border-radius: 12px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid var(--text);
    transition: all 0.1s ease;
    box-shadow: 0 4px 0 var(--text);
}

.sound-toggle:hover {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--text);
}

.sound-toggle i {
    color: var(--text);
    font-size: 18px;
}
