/* Lucky Score - App Specific Styles */

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

body {
    font-family: var(--font-body);
    background: #F5F0E8;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    padding-top: env(safe-area-inset-top);
    overflow-x: hidden;
}

.app {
    width: 100%;
    max-width: 428px;
    height: 100vh;
    height: 100dvh;
    background: #F5F0E8;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
    position: relative;
    padding-top: clamp(110px, 18vh, 140px);
    overflow: hidden;
}

/* Standalone mode (Add to Home Screen) safe area offsets */
@supports (padding-top: env(safe-area-inset-top)) {
    .back-button {
        top: calc(clamp(10px, 1.5vh, 14px) + env(safe-area-inset-top));
    }
    #logo-link {
        top: calc(clamp(8px, 0.5vh, 8px) + env(safe-area-inset-top));
    }
    #title {
        top: calc(clamp(18px, 4.5vh, 40px) + env(safe-area-inset-top));
    }
    .app {
        padding-top: calc(clamp(110px, 18vh, 140px) + env(safe-area-inset-top));
    }
}

/* Guide Button */
.guide-btn {
    position: absolute;
    top: clamp(10px, 1.5vh, 14px);
    right: clamp(10px, 1.5vw, 14px);
    z-index: 1001;
    width: clamp(40px, 8vw, 48px);
    height: clamp(40px, 8vw, 48px);
    background: linear-gradient(135deg, #fd243d 0%, #ff5670 100%);
    border: none;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(253, 36, 61, 0.3);
}

.guide-btn svg {
    width: 18px;
    height: 18px;
}

.guide-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(253, 36, 61, 0.4);
}

.guide-btn:active {
    transform: scale(0.95);
}


/* Hidden utility */
.hidden {
    display: none !important;
}

/* ==================== SESSION ENTRY ==================== */
.session-entry-view {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
}

.session-entry-container {
    padding: 20px;
    padding-bottom: 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.session-card {
    background: white;
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.session-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #fd243d;
    margin: 0 0 16px 0;
    font-family: var(--font-body);
    text-align: center;
}

.session-input-group {
    margin-bottom: 16px;
}

.session-input-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    margin-bottom: 6px;
    font-family: var(--font-body);
}

.session-input-group input[type="text"] {
    width: 100%;
    height: 44px;
    border: 1px solid #E0E0E0;
    border-radius: 10px;
    padding: 0 14px;
    font-size: 15px;
    font-family: var(--font-body);
    color: #333;
    transition: border-color 0.2s;
}

.session-input-group input[type="text"]:focus {
    outline: none;
    border-color: #fd243d;
}

.code-input-container {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.code-digit {
    width: 56px;
    height: 64px;
    border: 2px solid #E0E0E0;
    border-radius: 12px;
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    font-family: var(--font-body);
    color: #fd243d;
    transition: border-color 0.2s;
}

.code-digit:focus {
    outline: none;
    border-color: #fd243d;
    background: #FFF5F5;
}

.session-btn {
    width: 100%;
    height: 48px;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.session-btn.primary {
    background: #fd243d;
    color: white;
    border: none;
}

.session-btn.primary:hover {
    background: #e01f36;
}

.session-btn.primary:active {
    transform: scale(0.98);
}

.session-btn.primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.session-btn.secondary {
    background: white;
    color: #fd243d;
    border: 2px solid #fd243d;
}

.session-btn.secondary:hover {
    background: #FFF5F5;
}

.session-btn.secondary:active {
    transform: scale(0.98);
}

.session-btn.danger {
    background: white;
    color: #dc3545;
    border: 2px solid #dc3545;
}

.session-btn.danger:hover {
    background: #fff5f5;
}

.session-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #999;
    font-size: 13px;
    font-family: var(--font-body);
}

.session-divider::before,
.session-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #E0E0E0;
}

.session-error {
    background: #fd243d;
    color: white;
    padding: 0;
    font-size: 13px;
    text-align: center;
    font-weight: 500;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    margin: 0 20px;
    border-radius: 8px;
}

.session-error.show {
    padding: 12px 16px;
    max-height: 60px;
}

/* ==================== SESSION LEADERBOARD ==================== */
.session-leaderboard-view {
    display: flex;
    flex-direction: column;
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #FFEDE8;
    border-bottom: 1px solid #FFE0E0;
}

.session-code-display {
    display: flex;
    align-items: center;
    gap: 6px;
}

.session-code-label {
    font-size: 12px;
    color: #666;
    font-family: var(--font-body);
}

.session-code-value {
    font-size: 20px;
    font-weight: 600;
    color: #fd243d;
    font-family: var(--font-body);
    letter-spacing: 3px;
}

.session-share-btn {
    width: 36px;
    height: 36px;
    border: 1.5px solid rgba(253, 36, 61, 0.4);
    border-radius: 8px;
    background: white;
    color: #fd243d;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.session-share-btn:hover {
    background: #FFF5F5;
    border-color: #fd243d;
}

/* ==================== LEADERBOARD TABLE ==================== */
.leaderboard-container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 12px;
}

.leaderboard-scroll-hint {
    font-size: 11px;
    color: #999;
    text-align: center;
    padding: 4px 0 8px;
    font-family: var(--font-body);
}

.leaderboard-scroll-hint.hidden {
    display: none;
}

.leaderboard-table-wrapper {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}


.leaderboard-table-wrapper.hidden {
    display: none;
}

.leaderboard-table {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 100%;
    font-family: var(--font-body);
    font-size: 13px;
}

.leaderboard-table th {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    background: #fd243d;
    color: white;
    font-weight: 600;
    padding: 10px 12px;
    text-align: center;
    white-space: nowrap;
    z-index: 1;
}

.leaderboard-table th.player-col {
    text-align: left;
    padding-left: 14px;
    padding-right: 20px;
    width: 100px;
    min-width: 100px;
    max-width: 120px;
    position: -webkit-sticky;
    position: sticky;
    left: 0;
    top: 0;
    z-index: 3;
    background: #fd243d;
}

.leaderboard-table th.total-col {
    padding: 10px 16px;
    position: -webkit-sticky;
    position: sticky;
    left: 100px;
    top: 0;
    z-index: 3;
    background: #fd243d;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
}

.leaderboard-table th.round-col {
    padding: 10px 8px;
    min-width: 55px;
}

.leaderboard-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    text-align: center;
    white-space: nowrap;
}

.leaderboard-table td.player-col {
    text-align: left;
    padding-left: 14px;
    padding-right: 20px;
    width: 100px;
    min-width: 100px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    position: -webkit-sticky;
    position: sticky;
    left: 0;
    z-index: 2;
    background: white;
}

.leaderboard-table td.total-col {
    font-weight: 600;
    color: #fd243d;
    padding: 12px 16px;
    position: -webkit-sticky;
    position: sticky;
    left: 100px;
    z-index: 2;
    background: white;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
}

.leaderboard-table tbody tr:last-child td {
    border-bottom: none;
}

.title-badges {
    font-size: 12px;
    margin-left: 6px;
}

.player-name {
    color: #333;
}

.round-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.2s;
}

.round-score:hover {
    background: #FFF5F5;
}

.round-score.final {
    cursor: default;
}

.round-score.final:hover {
    background: transparent;
}

.score-points {
    font-weight: 600;
    color: #2E7D32;
    font-size: 12px;
}

.score-type {
    font-size: 10px;
}

.leaderboard-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #666;
    font-family: var(--font-body);
    text-align: center;
    padding: 40px;
}

.leaderboard-empty.hidden {
    display: none;
}

.leaderboard-empty p {
    margin: 4px 0;
}

.leaderboard-empty .hint {
    font-size: 12px;
    color: #999;
}

/* ==================== TITLE HOLDERS ==================== */
.title-holders {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: #FFEDE8;
    border-top: 1px solid #FFE0E0;
    position: relative;
}

.title-info-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid rgba(253, 36, 61, 0.4);
    background: white;
    color: #fd243d;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.title-info-btn:hover {
    border-color: #fd243d;
    background: #FFF5F5;
}

.title-holder {
    flex: 1 1 45%;
    min-width: 140px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-family: var(--font-body);
    cursor: pointer;
    transition: background 0.2s;
}

.title-holder:active {
    background: #FFF5F5;
}

.title-holder .title-icon {
    font-size: 16px;
}

.title-holder .title-label {
    color: #666;
    flex-shrink: 0;
}

.title-holder .title-player {
    color: #fd243d;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==================== SESSION ACTION BUTTONS ==================== */
.session-actions {
    display: flex;
    gap: 10px;
    padding: 12px;
}

.add-score-btn,
.add-player-btn {
    flex: 1;
    border-radius: 24px;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
}

.add-score-btn {
    background: #fd243d;
    color: white;
    border: none;
}

.add-score-btn:hover {
    background: #e01f36;
}

.add-player-btn {
    background: white;
    color: #fd243d;
    border: 2px solid #fd243d;
}

.add-player-btn:hover {
    background: #FFF5F5;
}

.add-score-btn:active,
.add-player-btn:active {
    transform: scale(0.98);
}

/* ==================== END SESSION BUTTON ==================== */
.end-session-btn {
    margin: 0 12px 12px;
    background: white;
    color: #dc3545;
    border: 2px solid #dc3545;
    border-radius: 24px;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s;
}

.end-session-btn:hover {
    background: #fff5f5;
}

.end-session-btn.hidden {
    display: none;
}


/* ==================== SESSION ENDED ==================== */
.session-ended-view {
    display: flex;
    flex-direction: column;
}

.session-ended-header {
    text-align: center;
    padding: 16px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
}

.session-ended-header h2 {
    margin: 0;
    font-size: 20px;
    color: white;
    font-family: var(--font-body);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.final-leaderboard {
    padding: 12px;
}

.final-titles {
    flex-direction: column;
    gap: 8px;
}

.final-titles h3 {
    width: 100%;
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #fd243d;
    font-family: var(--font-body);
    text-align: center;
}

.title-holder-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-family: var(--font-body);
}

.title-holder-row .title-icon {
    font-size: 20px;
    width: 28px;
    text-align: center;
}

.title-holder-row .title-label {
    color: #666;
    width: 90px;
}

.title-holder-row .title-player {
    flex: 1;
    color: #fd243d;
    font-weight: 600;
}

.title-holder-row .title-stat {
    color: #999;
    font-size: 11px;
}

.session-ended-actions {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rank {
    color: #999;
    font-weight: normal;
}

/* ==================== SCORE MODAL ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 2000;
}

#titleLegendOverlay {
    align-items: center;
}

.modal-overlay.hidden {
    display: none;
}

.score-modal {
    background: white;
    width: 100%;
    max-width: 428px;
    border-radius: 20px 20px 0 0;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #333;
    font-family: var(--font-body);
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 20px;
}

.modal-input-group {
    margin-bottom: 20px;
}

.modal-input-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    margin-bottom: 8px;
    font-family: var(--font-body);
}

.modal-input-group select,
.modal-input-group input[type="text"] {
    width: 100%;
    height: 52px;
    border: 2px solid #E0E0E0;
    border-radius: 12px;
    padding: 0 16px;
    font-size: 17px;
    font-family: var(--font-body);
    color: #333;
    background: white;
    -webkit-appearance: none;
    appearance: none;
}

.modal-input-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.modal-input-group select:focus,
.modal-input-group input[type="text"]:focus {
    outline: none;
    border-color: #fd243d;
}

.win-type-toggle {
    display: flex;
    gap: 10px;
}

.win-type-btn {
    flex: 1;
    height: 48px;
    border: 2px solid #E0E0E0;
    border-radius: 10px;
    background: white;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-body);
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.win-type-btn.active {
    border-color: #fd243d;
    color: #fd243d;
    background: #FFF5F5;
}

.win-type-btn:hover:not(.active) {
    border-color: #ccc;
}

.points-input-container {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.points-btn {
    width: 48px;
    height: 48px;
    border: 2px solid #E0E0E0;
    border-radius: 12px;
    background: white;
    font-size: 24px;
    font-weight: 300;
    color: #fd243d;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.points-btn:hover {
    border-color: #fd243d;
    background: #FFF5F5;
}

.points-btn:active {
    transform: scale(0.95);
}

#scorePointsInput {
    width: 80px;
    height: 56px;
    border: 2px solid #E0E0E0;
    border-radius: 12px;
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    font-family: var(--font-body);
    color: #fd243d;
}

#scorePointsInput:focus {
    outline: none;
    border-color: #fd243d;
}

.feeder-group.hidden {
    display: none;
}

.modal-footer {
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-error {
    background: #fd243d;
    color: white;
    padding: 0;
    font-size: 13px;
    text-align: center;
    font-weight: 500;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    margin: 0 20px 20px;
    border-radius: 8px;
}

.modal-error.show {
    padding: 12px 16px;
    max-height: 60px;
}

/* ==================== TITLE LEGEND MODAL ==================== */
.legend-modal {
    background: white;
    width: 90%;
    max-width: 340px;
    border-radius: 16px;
    margin: auto;
    overflow: hidden;
}

.legend-body {
    padding: 16px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.legend-icon {
    font-size: 28px;
    width: 40px;
    text-align: center;
}

.legend-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.legend-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    font-family: var(--font-body);
}

.legend-desc {
    font-size: 13px;
    color: #666;
    font-family: var(--font-body);
}


/* ==================== DICE MODAL ==================== */

/* Dice Button (below guide button) */
.dice-float-btn {
    position: absolute;
    top: calc(clamp(10px, 1.5vh, 14px) + clamp(40px, 8vw, 48px) + 12px);
    right: clamp(10px, 1.5vw, 14px);
    z-index: 1001;
    width: clamp(40px, 8vw, 48px);
    height: clamp(40px, 8vw, 48px);
    background: linear-gradient(135deg, #fd243d 0%, #ff5670 100%);
    border: none;
    border-radius: 50%;
    color: white;
    display: none; /* Hidden by default, shown via JavaScript */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: clamp(20px, 5vw, 24px);
    box-shadow: 0 4px 12px rgba(253, 36, 61, 0.3);
}

.dice-float-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(253, 36, 61, 0.4);
}

.dice-float-btn:active {
    transform: scale(0.95);
}

/* Dice Modal */
.dice-modal {
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.dice-modal-body {
    padding-top: 12px;
}

.dice-container-modal {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
}

/* Mini Dice (matches original dice app) */
.dice-mini {
    width: 90px;
    height: 90px;
    background: white;
    border: 3px solid #fd243d;
    border-radius: 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(253, 36, 61, 0.2);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.dice-mini:hover {
    box-shadow: 0 8px 25px rgba(253, 36, 61, 0.3);
    transform: translateY(-5px) scale(1.05);
}

.dice-mini:active {
    transform: scale(0.95);
}

.dice-mini .dot {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #ff6b7a 0%, #fd243d 100%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s, transform 0.3s ease;
    margin: auto;
    box-shadow: 0 2px 4px rgba(253, 36, 61, 0.3);
}

.dice-mini .dot.active {
    opacity: 1;
    animation: dotPulse 2s infinite ease-in-out;
}

.dice-mini .dot.active:nth-child(odd) {
    animation-delay: 0.3s;
}

.dice-mini .dot.active:nth-child(even) {
    animation-delay: 0.6s;
}

.dice-mini.wiggle {
    animation: wiggle 0.5s ease-in-out;
}

.dice-mini.shaking {
    animation: cuteShake 0.4s ease-in-out;
}

.dice-mini.rolling {
    animation: cuteDiceRoll 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dice-mini.landed {
    animation: cuteGlow 0.6s ease-out;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg) scale(1); }
    10% { transform: rotate(-8deg) scale(1.05); }
    20% { transform: rotate(8deg) scale(0.95); }
    30% { transform: rotate(-8deg) scale(1.05); }
    40% { transform: rotate(8deg) scale(0.95); }
    50% { transform: rotate(-4deg) scale(1.02); }
    60% { transform: rotate(4deg) scale(0.98); }
    70% { transform: rotate(-4deg) scale(1.02); }
    80% { transform: rotate(4deg) scale(0.98); }
    90% { transform: rotate(-2deg) scale(1.01); }
}

@keyframes cuteShake {
    0%, 100% { transform: translateX(0) rotate(0deg) scale(1); }
    10% { transform: translateX(-3px) rotate(-5deg) scale(1.05); }
    20% { transform: translateX(3px) rotate(5deg) scale(0.95); }
    30% { transform: translateX(-3px) rotate(-5deg) scale(1.05); }
    40% { transform: translateX(3px) rotate(5deg) scale(0.95); }
    50% { transform: translateX(-2px) rotate(-3deg) scale(1.03); }
    60% { transform: translateX(2px) rotate(3deg) scale(0.97); }
    70% { transform: translateX(-2px) rotate(-3deg) scale(1.03); }
    80% { transform: translateX(2px) rotate(3deg) scale(0.97); }
    90% { transform: translateX(-1px) rotate(-1deg) scale(1.01); }
}

@keyframes cuteDiceRoll {
    0% { transform: translateY(0) rotate(0deg) scale(1, 1); }
    5% { transform: translateY(-5px) rotate(-5deg) scale(1.1, 0.9); }
    10% { transform: translateY(-20px) rotate(-10deg) scale(0.9, 1.1); }
    15% { transform: translateY(-80px) rotate(180deg) scale(1.2, 0.8); }
    20% { transform: translateY(-120px) rotate(270deg) scale(0.8, 1.2); }
    25% { transform: translateY(-140px) rotate(360deg) scale(1.15, 0.85); }
    30% { transform: translateY(-150px) rotate(450deg) scale(0.85, 1.15); }
    35% { transform: translateY(-140px) rotate(540deg) scale(1.1, 0.9); }
    40% { transform: translateY(-100px) rotate(630deg) scale(0.9, 1.1); }
    45% { transform: translateY(-50px) rotate(720deg) scale(1.05, 0.95); }
    50% { transform: translateY(-20px) rotate(810deg) scale(0.95, 1.05); }
    55% { transform: translateY(0) rotate(900deg) scale(1.2, 0.8); }
    60% { transform: translateY(-15px) rotate(990deg) scale(0.8, 1.2); }
    65% { transform: translateY(0) rotate(1080deg) scale(1.1, 0.9); }
    70% { transform: translateY(-8px) rotate(1080deg) scale(0.9, 1.1); }
    75% { transform: translateY(0) rotate(1080deg) scale(1.15, 0.85); }
    80% { transform: translateY(-4px) rotate(1080deg) scale(0.85, 1.15); }
    85% { transform: translateY(0) rotate(1080deg) scale(1.05, 0.95); }
    90% { transform: translateY(-2px) rotate(1080deg) scale(0.95, 1.05); }
    95% { transform: translateY(0) rotate(1080deg) scale(1.02, 0.98); }
    100% { transform: translateY(0) rotate(1080deg) scale(1, 1); }
}

@keyframes dotPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(253, 36, 61, 0.3);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 3px 8px rgba(253, 36, 61, 0.5);
    }
}

@keyframes cuteGlow {
    0% {
        box-shadow: 0 5px 15px rgba(253, 36, 61, 0.2);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 5px 40px rgba(253, 36, 61, 0.6),
                    0 0 60px rgba(255, 192, 203, 0.4),
                    inset 0 0 20px rgba(255, 182, 193, 0.2);
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 5px 15px rgba(253, 36, 61, 0.2);
        transform: scale(1);
    }
}

/* Sparkle animation (matches original) */
.sparkle {
    position: fixed;
    pointer-events: none;
    font-size: 20px;
    z-index: 9999;
    animation: floatUp 1.2s ease-out forwards;
}

@keyframes floatUp {
    0% {
        transform: translate(0, 0) scale(0) rotate(0deg);
        opacity: 0;
    }
    20% {
        transform: translate(var(--x), calc(var(--y) * 0.3)) scale(1.2) rotate(180deg);
        opacity: 1;
    }
    40% {
        transform: translate(calc(var(--x) * 1.5), calc(var(--y) * 0.6)) scale(0.8) rotate(360deg);
    }
    100% {
        transform: translate(calc(var(--x) * 2), var(--y)) scale(0) rotate(720deg);
        opacity: 0;
    }
}

.sparkle.heart-particle {
    color: #fd243d;
    animation: heartFloat 1.5s ease-out forwards;
}

@keyframes heartFloat {
    0% {
        transform: translate(0, 0) scale(0) rotate(0deg);
        opacity: 0;
    }
    20% {
        transform: translate(var(--x), calc(var(--y) * 0.3)) scale(1.3) rotate(-20deg);
        opacity: 1;
    }
    40% {
        transform: translate(calc(var(--x) * 1.2), calc(var(--y) * 0.5)) scale(1) rotate(20deg);
    }
    60% {
        transform: translate(calc(var(--x) * 1.5), calc(var(--y) * 0.7)) scale(1.1) rotate(-10deg);
    }
    100% {
        transform: translate(calc(var(--x) * 2), var(--y)) scale(0) rotate(45deg);
        opacity: 0;
    }
}

/* Roll Button */
.dice-roll-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #fd243d 0%, #ff5670 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: var(--font-body);
}

.dice-roll-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(253, 36, 61, 0.3);
}

.dice-roll-btn:active:not(:disabled) {
    transform: translateY(0);
}

.dice-roll-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Dice Result */
.dice-result {
    margin-top: 20px;
    padding: 16px;
    background: rgba(253, 36, 61, 0.05);
    border-radius: 12px;
    text-align: center;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.3s;
}

.dice-result.show {
    opacity: 1;
    transform: translateY(0);
}

.dice-sum {
    font-size: 20px;
    font-weight: 700;
    color: #fd243d;
    margin-bottom: 4px;
    font-family: var(--font-body);
}

.dice-breakdown {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-family: var(--font-body);
}

.dice-direction {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-top: 8px;
    font-family: var(--font-body);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .dice-mini {
        width: 80px;
        height: 80px;
        padding: 10px;
    }

    .dice-mini .dot {
        width: 13px;
        height: 13px;
    }
}
