* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow: hidden;
    width: 100%;
    height: 100%;
    position: fixed;
    -webkit-overflow-scrolling: touch;
}

#container {
    width: 100vw;
    height: 100vh;
    position: relative;
    touch-action: none;
}

#info {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    z-index: 100;
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    min-width: 300px;
    max-width: 500px;
}

.info-toggle {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 101;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.info-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.info-content {
    transition: all 0.3s ease;
}

.language-selector {
    margin-bottom: 15px;
}

#languageSelect {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    outline: none;
}

#languageSelect:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

#languageSelect:focus {
    background: rgba(255, 255, 255, 0.3);
    border-color: #f093fb;
    box-shadow: 0 0 10px rgba(240, 147, 251, 0.5);
}

#languageSelect option {
    background: #2d3748;
    color: white;
    padding: 8px;
}

#info h1 {
    margin-bottom: 10px;
    font-size: 36px;
}

#info p {
    margin-bottom: 5px;
    font-size: 20px;
    opacity: 0.9;
}

.probability-info {
    margin-top: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.probability-info h3 {
    margin-bottom: 8px;
    font-size: 22px;
    color: #ffeb3b;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.probability-info p {
    margin-bottom: 4px;
    font-size: 18px;
    display: flex;
    align-items: center;
}

.level-1 {
    color: #667eea;
    font-weight: bold;
    margin-right: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.level-2 {
    color: #f093fb;
    font-weight: bold;
    margin-right: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.level-3 {
    color: #4facfe;
    font-weight: bold;
    margin-right: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.note {
    margin-top: 8px !important;
    font-size: 16px !important;
    color: #ffeb3b !important;
    font-style: italic;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    border-top: 1px solid rgba(255, 235, 59, 0.3);
    padding-top: 8px;
}

.probability-mode-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.mode-button {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.mode-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.mode-button.active {
    background: linear-gradient(145deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.probability-slider-container {
    margin: 12px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.probability-count-container {
    margin: 12px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.count-input-group {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.count-input-group label {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.count-input-group input[type="number"] {
    width: 100px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
}

.count-input-group input[type="number"]:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.count-input-group input[type="number"]:focus {
    background: rgba(255, 255, 255, 0.3);
    border-color: #f093fb;
    box-shadow: 0 0 8px rgba(240, 147, 251, 0.5);
}

.count-result {
    margin-top: 10px;
    padding: 8px;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 6px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
    border: 1px solid rgba(102, 126, 234, 0.4);
}

.count-result span:last-child {
    color: #f093fb;
    font-size: 18px;
}

.probability-slider-container label {
    display: block;
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

#probabilityValue {
    color: #f093fb;
    font-size: 20px;
}

#probabilitySlider {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

#probabilitySlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(145deg, #f093fb 0%, #f5576c 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

#probabilitySlider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 8px rgba(240, 147, 251, 0.5);
}

#probabilitySlider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(145deg, #f093fb 0%, #f5576c 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

#probabilitySlider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 8px rgba(240, 147, 251, 0.5);
}

.color-theme-container {
    margin: 15px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.color-theme-container h4 {
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.theme-buttons {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.theme-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.theme-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.theme-button.active {
    background: linear-gradient(145deg, #f093fb 0%, #f5576c 100%);
    border-color: #f093fb;
    box-shadow: 0 3px 10px rgba(240, 147, 251, 0.4);
}

.color-preview {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.color-preview.red {
    background: #ff4444;
}

.color-preview.blue {
    background: #4444ff;
}

.color-preview.black {
    background: #000000;
}

.color-preview.white {
    background: #ffffff;
}

.share-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.share-button {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(145deg, #667eea 0%, #764ba2 100%);
    border: 2px solid rgba(102, 126, 234, 0.5);
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.share-button:hover {
    background: linear-gradient(145deg, #5a67d8 0%, #6b46c1 100%);
    border-color: rgba(102, 126, 234, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.share-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.bottom-ad-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottom-ad-container:empty {
    display: none;
}

#controls {
    position: absolute;
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

#rotationButton {
    padding: 32px 48px;
    font-size: 24px;
    font-weight: 600;
    border: none;
    border-radius: 25px;
    background: linear-gradient(145deg, #f093fb 0%, #f5576c 100%);
    color: white;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow:
        0 10px 30px rgba(240, 147, 251, 0.4),
        0 5px 15px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    min-width: 200px;
    min-height: 100px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

#rotationButton::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

#rotationButton:hover::before {
    left: 100%;
}

.start-text {
    font-size: clamp(50px, 10vw, 90px);
    font-weight: 700;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

/* Rotation animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Rotate text when button is disabled */
#rotationButton:disabled .start-text {
    animation: spin 2s linear infinite;
    display: inline-block;
}

#rotationButton:hover {
    transform: translateY(-5px) scale(1.05);
    background: linear-gradient(145deg, #e879f9 0%, #ec4899 100%);
    box-shadow:
        0 15px 40px rgba(240, 147, 251, 0.5),
        0 8px 25px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

#rotationButton:active {
    transform: translateY(-3px) scale(1.03);
    box-shadow:
        0 8px 25px rgba(240, 147, 251, 0.4),
        0 4px 15px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

#rotationButton:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    background: linear-gradient(145deg, #4a5568 0%, #2d3748 100%);
    box-shadow:
        0 5px 20px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#rotationButton:disabled:hover {
    transform: none;
    background: linear-gradient(145deg, #4a5568 0%, #2d3748 100%);
    box-shadow:
        0 5px 20px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* iPad Pro responsive styles */
@media (max-width: 1366px) and (min-width: 1025px) {
    #rotationButton {
        padding: 28px 40px;
        font-size: 22px;
        min-width: 180px;
        min-height: 90px;
        border-radius: 22px;
    }

    .start-text {
        font-size: clamp(45px, 9vw, 80px);
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    #rotationButton {
        padding: 24px 36px;
        font-size: 20px;
        min-width: 160px;
        min-height: 80px;
        border-radius: 20px;
    }

    .start-text {
        font-size: clamp(40px, 8vw, 70px);
    }
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .info-toggle {
        display: block;
    }

    #info {
        top: 10px;
        left: 10px;
        right: 10px;
        padding: 15px;
        font-size: 14px;
        min-height: 50px;
        min-width: auto;
        max-width: calc(100vw - 20px);
        overflow: hidden;
    }

    #info.collapsed {
        height: 50px;
        padding: 10px;
    }

    #info.collapsed .info-content {
        opacity: 0;
        transform: translateY(-20px);
        pointer-events: none;
    }

    .info-content {
        opacity: 1;
        transform: translateY(0);
    }

    #controls {
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 20px);
        max-width: 400px;
    }

    #rotationButton {
        padding: 20px 32px;
        font-size: 18px;
        min-width: 160px;
        min-height: 75px;
        border-radius: 18px;
        width: 100%;
    }

    .start-text {
        font-size: clamp(35px, 7vw, 60px);
    }

    #info h1 {
        font-size: 24px;
        margin-bottom: 8px;
    }

    #info p {
        font-size: 14px;
        margin-bottom: 4px;
    }

    .probability-info {
        margin-top: 10px;
        padding: 8px;
    }

    .probability-info h3 {
        font-size: 16px;
        margin-bottom: 6px;
    }

    .probability-info p {
        font-size: 13px;
        margin-bottom: 3px;
    }

    .note {
        font-size: 11px !important;
        margin-top: 6px !important;
        padding-top: 6px;
    }

    .probability-mode-selector {
        gap: 6px;
        margin-bottom: 10px;
    }

    .mode-button {
        padding: 6px 10px;
        font-size: 13px;
    }

    .count-input-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 12px;
    }

    .count-input-group label {
        font-size: 14px;
    }

    .count-input-group input[type="number"] {
        width: 100%;
        max-width: 150px;
    }

    .count-result {
        font-size: 14px;
    }

    .theme-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .theme-button {
        padding: 8px 10px;
        font-size: 13px;
    }

    .share-button {
        padding: 10px 16px;
        font-size: 14px;
    }

    #languageSelect {
        font-size: 14px;
        padding: 6px 10px;
    }

    .probability-slider-container label {
        font-size: 14px;
    }

    #probabilityValue {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .info-toggle {
        display: block;
        width: 35px;
        height: 35px;
        font-size: 18px;
        top: 5px;
        right: 5px;
    }

    #info {
        top: 5px;
        left: 5px;
        right: 5px;
        padding: 10px;
        min-height: 45px;
        min-width: auto;
        max-width: calc(100vw - 10px);
    }

    #info.collapsed {
        height: 45px;
        padding: 8px;
    }

    #controls {
        bottom: 5px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 10px);
        max-width: 350px;
    }

    #rotationButton {
        padding: 16px 24px;
        font-size: 16px;
        min-width: 140px;
        min-height: 65px;
        border-radius: 15px;
        width: 100%;
    }

    .start-text {
        font-size: clamp(30px, 6vw, 50px);
    }

    #info h1 {
        font-size: 20px;
    }

    #info p {
        font-size: 12px;
    }

    .probability-info {
        padding: 6px;
    }

    .probability-info h3 {
        font-size: 14px;
        margin-bottom: 5px;
    }

    .probability-info p {
        font-size: 11px;
    }

    .note {
        font-size: 10px !important;
    }

    .mode-button {
        padding: 5px 8px;
        font-size: 12px;
    }

    .count-input-group label {
        font-size: 12px;
    }

    .count-input-group input[type="number"] {
        font-size: 14px;
        padding: 5px 8px;
    }

    .count-result {
        font-size: 12px;
        padding: 6px;
    }

    .color-theme-container h4 {
        font-size: 14px;
    }

    .theme-button {
        padding: 6px 8px;
        font-size: 12px;
    }

    .share-button {
        padding: 8px 12px;
        font-size: 13px;
    }

    #languageSelect {
        font-size: 13px;
        padding: 5px 8px;
    }

    .probability-slider-container {
        padding: 8px;
    }

    .probability-slider-container label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    #probabilityValue {
        font-size: 14px;
    }

    .color-preview {
        width: 14px;
        height: 14px;
    }
}

