:root {
    --b: #7EBACD;
    --i: #FF8B84;
    --n: #89D5ED;
    --g: #FFC499;
    --o: #D19DDA;
    --x2: #FF747E; 
    --bg-main: #FFF5EE;
    --text-dark: #2D2D2D;
    --bg: #BAA2F6;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', sans-serif; touch-action: manipulation; }
body { background: #1a1a1a; display: flex; justify-content: center; height: 100dvh; overflow: hidden; }

.ad-top-container {
    width: 320px;
    height: 100px;
    margin: 0 auto 10px auto;
    background: #fdf2f2; 
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    border-radius: 10px;
}


.pdd-hub-link-secondary {
  display: block;
  margin-top: 10px;
  text-align: center;
  font-size: 1.17rem;
  color: #999;
  text-decoration: none;
}



.overlay, .overlay-top { 
    position: fixed; inset: 0; background: rgba(0,0,0,0.85); 
    z-index: 5000; display: flex; align-items: center; justify-content: center; text-align: center; 
}
.overlay-top { z-index: 9999; }
.menu-card, .rules-card { background: white; padding: 25px; border-radius: 25px; border: 4px solid var(--i); color: var(--text-dark); width: 90%; max-width: 380px; }
.logo-ball { width: 60px; height: 60px; background: var(--i); border-radius: 50%; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 900; color: white; }

.primary-btn { background: var(--i); border: none; padding: 18px; color: white; font-weight: bold; border-radius: 12px; cursor: pointer; font-size: 1.2rem; width: 100%; margin-bottom: 10px; }
.secondary-btn { background: #eee; border: none; padding: 12px; color: var(--text-dark); border-radius: 12px; cursor: pointer; width: 100%; }

.game-container { width: 100%; max-width: 450px; background: var(--bg-main); padding: 8px 12px; display: flex; flex-direction: column; position: relative; height: 100%; }
.top-stats { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; font-size: 1.4rem; font-weight: 900; color: var(--text-dark); margin-bottom: 2px; position: relative; }

.top-stats {
    isolation: isolate;
    overflow: visible;
}

.x2-fx {
    position: absolute;
    inset: -4px -4px -4px 0;
    border-radius: 18px;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    background:
        linear-gradient(90deg, rgba(255,184,28,0.24) 0%, rgba(255,193,7,0.52) 24%, rgba(255,230,138,0.74) 50%, rgba(255,193,7,0.52) 76%, rgba(255,184,28,0.24) 100%);
    box-shadow:
        0 0 0 1px rgba(255,219,110,0.34) inset,
        0 0 24px rgba(255,193,7,0.34),
        0 0 38px rgba(255,160,0,0.22);
    transition: opacity 0.2s ease;
}

.x2-fx.active {
    opacity: 1;
    animation: x2Pulse 1.4s ease-in-out infinite;
}

@keyframes x2Pulse {
    0%, 100% {
        transform: scaleY(0.96);
        filter: brightness(1);
        box-shadow:
            0 0 0 1px rgba(255,219,110,0.28) inset,
            0 0 22px rgba(255,193,7,0.28),
            0 0 32px rgba(255,160,0,0.18);
    }
    50% {
        transform: scaleY(1.03);
        filter: brightness(1.12);
        box-shadow:
            0 0 0 1px rgba(255,224,138,0.44) inset,
            0 0 30px rgba(255,193,7,0.42),
            0 0 46px rgba(255,160,0,0.26);
    }
}

.timer-wrap, .score-wrap, .pause-btn {
    position: relative;
    z-index: 2;
}

.tombola-wrap {
    position: relative;
    margin-bottom: 5px;
}

.purple-fx {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 22px;
    opacity: 0;
    pointer-events: none;
    z-index: 5;
    background:
        radial-gradient(circle at 50% 50%, rgba(208,157,218,0.92) 0%, rgba(160,90,210,0.9) 55%, rgba(123,63,242,0.92) 100%);
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.22),
        0 10px 24px rgba(96,31,154,0.22);
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: scale(0.97);
    overflow: hidden;
}

.purple-fx::before,
.purple-fx::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
    opacity: 0.45;
}

.purple-fx::before {
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0) 68%);
    top: -58px;
    left: -24px;
    animation: purpleFloat 5.2s ease-in-out infinite;
}

.purple-fx::after {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 72%);
    right: -40px;
    bottom: -84px;
    animation: purpleFloatAlt 6.1s ease-in-out infinite;
}

.purple-fx.active {
    opacity: 1;
    transform: scale(1);
    animation: purplePulse 1.9s ease-in-out infinite;
}

.purple-fx-inner {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    text-shadow: 0 3px 12px rgba(78,24,126,0.35);
}

.purple-fx-title {
    font-size: 1.08rem;
    font-weight: 900;
    letter-spacing: 1.2px;
    margin-bottom: 2px;
}

.purple-fx-timer {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
}

@keyframes purplePulse {
    0%, 100% {
        box-shadow:
            inset 0 0 0 1px rgba(255,255,255,0.22),
            0 10px 24px rgba(96,31,154,0.22);
    }
    50% {
        box-shadow:
            inset 0 0 0 1px rgba(255,255,255,0.34),
            0 12px 30px rgba(96,31,154,0.28);
    }
}

@keyframes purpleFloat {
    0%, 100% { transform: translate3d(0,0,0) scale(1); }
    50% { transform: translate3d(14px,8px,0) scale(1.06); }
}

@keyframes purpleFloatAlt {
    0%, 100% { transform: translate3d(0,0,0) scale(1); }
    50% { transform: translate3d(-16px,-10px,0) scale(1.08); }
}

.status-banner { 
    display: none !important;
}

.tombola-container { display: flex; flex-direction: row; justify-content: center; gap: 8px; height: 60px; align-items: center; margin-bottom: 5px; }

.ball-ui { 
    width: 50px; 
    height: 50px; 
    color: white; 
    font-weight: 900; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.1rem; 
    flex-shrink: 0; 
    clip-path: path('M24 45.2471C24 45.2471 42.7059 34.4118 42.7059 21.3529C42.7059 8.29412 30.3529 6 24 16.5882C17.6471 6 5.29412 8.29412 5.29412 21.3529C5.29412 34.4118 24 45.2471 24 45.2471Z');
    transform: scale(1.1);
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}

/* ÚNICO CAMBIO: Nueva bola resaltada con animación y brillo */
.ball-new {
    transform: scale(1.50);
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.8)) drop-shadow(0 0 4px rgba(0,0,0,0.3));
    animation: pulseBall 1.2s infinite ease-in-out;
}

@keyframes pulseBall {
    0%, 100% { transform: scale(1.35); }
    50% { transform: scale(1.45); }
}

.bingo-header { display: grid; grid-template-columns: repeat(5, 1fr); text-align: center; font-size: 2rem; font-weight: 900; margin-bottom: 2px; }
.b-txt { color: var(--b); } .i-txt { color: var(--i); } .n-txt { color: var(--n); } .g-txt { color: var(--g); } .o-txt { color: var(--o); }

.board-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0px; flex-grow: 1; border: 1px solid #ddd; max-height: 45vh; }
.cell { background: #fff; border: 1px solid #eee; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 900; cursor: pointer; color: var(--text-dark); }
.c-b, .c-i, .c-n, .c-g, .c-o { color: var(--text-dark); }
.cell.marked { background: var(--text-dark) !important; color: white !important; }
.cell.line-marked { background: var(--bg) !important; color: var(--text-dark) !important; }
.claim-heart {
    color: #FFFFFF !important;
    font-family: Arial, Helvetica, "Segoe UI Symbol", "Noto Sans Symbols 2", "Noto Sans Symbols", sans-serif !important;
    font-style: normal;
    font-weight: 900;
    line-height: 1;
    display: inline-block;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

@keyframes cellMarkPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

.cell.mark-pulse {
    animation: cellMarkPulse 0.22s ease-out;
}

.footer-area { height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-top: 10px; padding: 0 2px; }

.p-container { display: flex; flex-direction: column; align-items: center; width: 100px; position: relative; }
.p-full-label { font-size: 0.6rem; font-weight: 900; color: var(--i); margin-bottom: 2px; opacity: 0; transition: opacity 0.2s; }
.p-bar-track { width: 100%; height: 14px; background: #eee; border-radius: 8px; overflow: hidden; border: 1px solid #ddd; }
#pBarFill { height: 100%; width: 0%; background: var(--n); transition: width 0.3s ease; }
#pBarFill.no-transition { transition: none !important; }

.p-stack { position: relative; width: 55px; height: 55px; display: flex; justify-content: center; }
.p-btn { position: absolute; width: 55px; height: 55px; border-radius: 50%; border: 3px solid white; color: white; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 900; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }

#bingoBtn { width: 110px; height: 60px; background: var(--i); color: white; border: none; border-radius: 15px; font-weight: 900; cursor: pointer; font-size: 1rem; }
#bingoBtn:disabled { background: #eee; color: #ccc; }

#countdownNumber { font-size: 10rem; font-weight: 900; color: var(--i); }
.selection-card { background: white; padding: 20px; border-radius: 20px; width: 90%; max-width: 350px; text-align: center; border: 4px solid var(--i); }
.sel-btn { padding: 15px; font-size: 2rem; font-weight: 900; border: 2px solid #eee; border-radius: 12px; background: var(--g); color: var(--text-dark); margin: 5px; width: 85px; }

.yellow-timer {
    margin-top: 10px;
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--text-dark);
    text-align: center;
    line-height: 1;
}

@keyframes bingoBtnPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

#bingoBtn.bingo-ready {
    animation: bingoBtnPulse 0.35s ease;
}


.score-wrap {
    position: relative;
    justify-self: center;
    display: flex;
    align-items: center;
}

#score {
    min-width: 90px;
    text-align: center;
}

.score-float {
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%) translateX(0);
    opacity: 0;
    pointer-events: none;
    color: var(--i);
    font-size: 1rem;
    font-weight: 900;
    white-space: nowrap;
    z-index: 6;
}

.score-float.x2-active {
    color: #ffbf1f;
    text-shadow: 0 0 10px rgba(255,196,57,0.5), 0 2px 4px rgba(0,0,0,0.12);
}

.score-float.show {
    animation: scoreFloatAnim 0.8s ease-out forwards;
}

.timer-wrap {
    position: relative;
    justify-self: start;
    display: flex;
    align-items: center;
}

.timer-float {
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%) translateX(0);
    opacity: 0;
    pointer-events: none;
    color: var(--b);
    font-size: 1rem;
    font-weight: 900;
    white-space: nowrap;
}

.timer-float.show {
    animation: scoreFloatAnim 0.8s ease-out forwards;
}


@keyframes scoreFloatAnim {
    0% { opacity: 0; transform: translateY(-50%) translateX(0) scale(0.9); }
    15% { opacity: 1; transform: translateY(-50%) translateX(4px) scale(1.12); }
    34% { opacity: 1; transform: translateY(-50%) translateX(7px) scale(1); }
    100% { opacity: 0; transform: translateY(calc(-50% - 12px)) translateX(12px) scale(0.96); }
}

.pause-btn {
    justify-self: end;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: white;
    color: var(--text-dark);
    font-size: 1.2rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}


#bingoBtn.bingo-active {
    animation: bingoBtnPulse 0.9s ease-in-out infinite;
}

@keyframes lineSweepFlash {
    0% { background: var(--text-dark); color: white; transform: scale(1); }
    50% { background: #ffe4bf; color: var(--text-dark); transform: scale(1.04); }
    100% { background: var(--g); color: var(--text-dark); transform: scale(1); }
}

.cell.line-claiming {
    animation: lineSweepFlash 0.22s ease-out forwards;
}


.start-overlay {
    background:
        radial-gradient(circle at 50% 14%, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0) 24%),
        linear-gradient(180deg, #f8e8de 0%, #f3dfd3 100%);
    overflow: hidden;
    padding: 24px;
}

.start-bg-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.start-panel {
    position: relative;
    z-index: 2;
    width: min(100%, 380px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.start-icon-wrap {
    position: relative;
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: -5px;
}

.start-icon-glow {
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,128,128,0.42) 0%, rgba(255,128,128,0.12) 52%, rgba(255,128,128,0) 75%);
    filter: blur(6px);
}

.start-icon {
    position: relative;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #ff9b97 0%, #ff7a78 100%);
    color: #c41d2f;
    font-size: 2.4rem;
    box-shadow: 0 14px 28px rgba(255,120,120,0.22), inset 0 3px 0 rgba(255,255,255,0.55);
}

.start-card {
    width: 100%;
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 34px;
    padding: 42px 22px 26px;
    box-shadow: 0 18px 40px rgba(119,78,63,0.12);
    position: relative;
}

.start-title {

    font-size: clamp(2.2rem, 7vw, 3rem);
    line-height: 0.92;
    letter-spacing: 1px;
    font-weight: 900;
    color: #ff7d7d;
    text-shadow: 0 4px 10px rgba(255,125,125,0.15);
    margin-bottom: 18px;
}

.start-brand {
    color: #4b3b3a;
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 30px;
}

.start-menu-btns {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.start-primary-btn {
    margin-bottom: 0;
    border-radius: 22px;
    padding: 22px 18px;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
    background: linear-gradient(180deg, #ff8d8d 0%, #ff6668 100%);
    box-shadow: 0 12px 24px rgba(255,106,108,0.28), inset 0 2px 0 rgba(255,255,255,0.45);
}

.start-secondary-btn {
    width: 78%;
    margin: 0 auto;
    border-radius: 18px;
    padding: 16px 18px;
    font-size: 0.95rem;
    font-weight: 800;
    background: linear-gradient(180deg, #f0f0f0 0%, #dddddd 100%);
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.8), 0 8px 18px rgba(0,0,0,0.06);
}

.start-version {
    position: absolute;
    right: 22px;
    bottom: 18px;
    font-size: 0.78rem;
    font-weight: 800;
    color: #5c4b4a;
}

.float-ball, .float-heart, .float-dot {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.float-ball {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    font-size: 1.15rem;
    font-weight: 900;
    color: rgba(255,255,255,0.92);
    box-shadow: inset 0 2px 8px rgba(255,255,255,0.3), 0 10px 20px rgba(0,0,0,0.06);
    opacity: 0.62;
}

.float-ball-b {
    left: 9%;
    top: 26%;
    background: rgba(126,186,205,0.72);
    animation: floatOne 10.5s ease-in-out infinite;
}

.float-ball-g {
    right: 8%;
    top: 37%;
    background: rgba(255,196,153,0.74);
    animation: floatTwo 11s ease-in-out infinite;
}

.float-ball-o {
    right: 10%;
    top: 18%;
    background: rgba(209,157,218,0.72);
    animation: floatThree 12s ease-in-out infinite;
}

.float-heart {
    color: rgba(213,35,59,0.9);
    font-size: 2.5rem;
    text-shadow: 0 6px 14px rgba(0,0,0,0.08);
    opacity: 0.9;
}

.heart-a {
    left: 5%;
    top: 33%;
    animation: floatTwo 10s ease-in-out infinite;
}

.heart-b {
    right: 4%;
    top: 48%;
    font-size: 2.2rem;
    animation: floatOne 11.4s ease-in-out infinite;
}

.heart-c {
    left: 11%;
    bottom: 16%;
    font-size: 2rem;
    opacity: 0.8;
    animation: floatThree 11.6s ease-in-out infinite;
}

.float-dot {
    border-radius: 50%;
    opacity: 0.5;
}

.dot-a {
    width: 58px;
    height: 58px;
    left: 16%;
    top: 16%;
    background: rgba(126,186,205,0.26);
    animation: floatDotOne 12.5s ease-in-out infinite;
}

.dot-b {
    width: 70px;
    height: 70px;
    right: 15%;
    top: 14%;
    background: rgba(255,139,132,0.22);
    animation: floatDotTwo 13.5s ease-in-out infinite;
}

.dot-c {
    width: 62px;
    height: 62px;
    left: 47%;
    bottom: 14%;
    background: rgba(126,186,205,0.16);
    animation: floatDotThree 14s ease-in-out infinite;
}

@keyframes floatOne {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -24px, 0); }
}

@keyframes floatTwo {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(12px, -20px, 0); }
}

@keyframes floatThree {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
    50% { transform: translate3d(-10px, -18px, 0) rotate(6deg); }
}

@keyframes floatDotOne {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(8px, -16px, 0) scale(1.06); }
}

@keyframes floatDotTwo {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(-10px, -18px, 0) scale(1.05); }
}

@keyframes floatDotThree {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(6px, -14px, 0) scale(1.04); }
}

@media (max-width: 420px) {
    .start-panel { width: min(100%, 340px); }
    .start-card { padding: 38px 18px 24px; border-radius: 30px; }
    .start-title { font-size: clamp(2.2rem, 12vw, 3rem); }
    .start-primary-btn { padding: 20px 16px; }
    .float-ball { width: 64px; height: 64px; font-size: 1rem; }
    .heart-a, .heart-b, .heart-c { font-size: 1.9rem; }
}


.end-breakdown {
    margin-top: 18px;
    text-align: left;
}

.end-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 0.98rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.end-row strong {
    font-size: 1rem;
    white-space: nowrap;
}

.end-divider {
    height: 2px;
    background: #f0d6cf;
    border-radius: 999px;
    margin: 18px 0 16px;
}

.final-score {
    font-size: 2.5rem;
    font-weight: 900;
    margin: 0 0 20px;
    color: var(--g);
}


.send-result-wrap {
    margin: 0 0 14px;
}

.player-name-input {
    width: 100%;
    border: 2px solid #f0d6cf;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    outline: none;
    margin-bottom: 10px;
    background: #fffaf8;
}

.player-name-input:focus {
    border-color: var(--i);
}

.send-result-btn {
    margin-bottom: 8px;
    font-weight: 900;
}

.send-result-btn:disabled {
    opacity: 0.7;
    cursor: default;
}

.send-result-status {
    min-height: 18px;
    font-size: 0.9rem;
    font-weight: 800;
    color: #7a5a58;
    text-align: center;
}


.start-panel {
    max-height: calc(100dvh - 48px);
}

.start-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 34px 18px 18px;
}

.start-title {
    margin-bottom: 12px;
}

.start-brand {
    margin-bottom: 20px;
}

.start-menu-btns {
    gap: 10px;
}

.start-primary-btn {
    padding: 18px 16px;
}

.start-secondary-btn {
    padding: 13px 16px;
}

.start-version {
    position: static;
    margin-top: 10px;
    text-align: right;
}

.ranking-preview {
    margin-top: 16px;
    padding: 12px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(255,246,243,0.96) 100%);
    border: 1px solid rgba(240,214,207,0.95);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.75), 0 10px 22px rgba(214,132,132,0.08);
}

.ranking-preview-head {
    text-align: center;
    margin-bottom: 8px;
}

.ranking-preview-head h3 {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 900;
    color: #5a4442;
}

.ranking-preview-sub {
    display: block;
    margin-top: 3px;
    font-size: 0.73rem;
    font-weight: 700;
    color: #8b6b68;
}

.ranking-open-btn {
    width: 100%;
    margin-top: 10px;
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 0.84rem;
    font-weight: 900;
}

.ranking-card {
    width: min(92vw, 410px);
    max-height: min(84dvh, 760px);
    background: linear-gradient(180deg, #fff8f6 0%, #fff1ef 100%);
    border-radius: 28px;
    padding: 18px 14px 14px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.18);
    border: 1px solid rgba(255,255,255,0.7);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ranking-card-head {
    text-align: center;
    flex: 0 0 auto;
}

.ranking-card-head h2 {
    margin: 0 0 3px;
    font-size: 1.35rem;
    font-weight: 900;
    color: #5a4442;
}

.ranking-card-head p {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: #8b6b68;
}

.ranking-card-footer {
    flex: 0 0 auto;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.full-ranking {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
}

.ranking-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 16px;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(240,214,207,0.9);
    box-shadow: 0 6px 14px rgba(0,0,0,0.04);
}

.ranking-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.ranking-pos {
    min-width: 32px;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.78rem;
    background: #f7ece9;
    color: #6b5250;
    flex-shrink: 0;
}

.ranking-name {
    font-size: 0.88rem;
    font-weight: 900;
    color: #4f3c3a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
}

.ranking-score {
    font-size: 0.84rem;
    font-weight: 900;
    color: #d24d63;
    white-space: nowrap;
}

.rank-top {
    transform: scale(1.005);
}

.rank-1 {
    background: linear-gradient(180deg, #fff5d9 0%, #fff0c1 100%);
    border-color: rgba(232, 192, 88, 0.5);
}

.rank-1 .ranking-pos {
    background: linear-gradient(180deg, #ffd76b 0%, #f0b83d 100%);
    color: #6b4300;
}

.rank-2 {
    background: linear-gradient(180deg, #f7f7fb 0%, #ececf6 100%);
    border-color: rgba(164, 168, 194, 0.45);
}

.rank-2 .ranking-pos {
    background: linear-gradient(180deg, #dfe3ef 0%, #bcc4d6 100%);
    color: #4a5366;
}

.rank-3 {
    background: linear-gradient(180deg, #ffe8db 0%, #ffd8c4 100%);
    border-color: rgba(209, 140, 104, 0.45);
}

.rank-3 .ranking-pos {
    background: linear-gradient(180deg, #f0b38e 0%, #d78c63 100%);
    color: #5a2d14;
}

.ranking-loading,
.ranking-empty {
    text-align: center;
    padding: 14px 10px;
    border-radius: 14px;
    background: rgba(255,255,255,0.82);
    border: 1px dashed rgba(214, 164, 164, 0.5);
    color: #7b6462;
    font-weight: 800;
    font-size: 0.84rem;
}

.compact-ranking {
    gap: 6px;
}

.compact-ranking .ranking-item {
    padding: 8px 9px;
}

.compact-ranking .ranking-pos {
    min-width: 28px;
    width: 28px;
    height: 28px;
    font-size: 0.72rem;
}

.compact-ranking .ranking-name {
    max-width: 132px;
    font-size: 0.83rem;
}

.compact-ranking .ranking-score {
    font-size: 0.78rem;
}

@media (max-width: 420px) {
    .start-overlay {
        padding: 16px;
    }

    .start-panel {
        width: min(100%, 346px);
    }

    .start-card {
        padding: 30px 14px 14px;
        border-radius: 28px;
    }

    .ranking-name {
        max-width: 116px;
    }

    .ranking-score {
        font-size: 0.78rem;
    }

    .ranking-card {
        padding: 16px 12px 12px;
        border-radius: 24px;
    }
}
