body {
    margin: 0;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(to right, #87CEEB 0%, #FFB6C1 100%);
    overflow-y: auto;
    position: relative;
}

h1 {
    margin: 15px 0;
    font-size: 36px;
    font-family: 'Fredoka One', cursive;
    color: #FFFFFF;
    text-shadow: 
        3px 3px 0px #FF6B6B,
        6px 6px 0px #4ECDC4,
        9px 9px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
    transform: rotate(-1deg);
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: rotate(-1deg) translateY(0);
    }
    50% {
        transform: rotate(1deg) translateY(-5px);
    }
}

canvas {
    border: 4px solid #FF6B6B;
    border-radius: 12px;
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.2),
        0 0 0 4px #FFFFFF,
        0 0 0 8px #4ECDC4;
    background-color: #FFFFFF;
}

#gamepadStatus {
    position: absolute;
    top: 10px;
    right: 10px;
    font-family: 'Fredoka One', cursive;
    font-size: 14px;
    padding: 8px 15px;
    background: linear-gradient(135deg, #FFE66D 0%, #FF6B6B 100%);
    border-radius: 20px;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.3),
        0 0 0 2px #FFFFFF;
    color: #FFFFFF;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

#gameRules {
    background: linear-gradient(135deg, #FFFFFF 0%, #FFF0F5 100%);
    border: 4px solid #FFB6C1;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 15px;
    max-width: 800px;
    width: 100%;
    box-shadow: 
        0 10px 20px rgba(0, 0, 0, 0.2),
        0 0 0 3px #FFFFFF,
        0 0 0 6px #FFB6C1;
    position: relative;
}

#gameRules h2 {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-family: 'Fredoka One', cursive;
    color: #FF6B6B;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(255, 107, 107, 0.3);
}

.rules-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
}

.rule-item {
    padding: 18px;
    background: linear-gradient(135deg, #FFF9E6 0%, #FFFFFF 100%);
    border-radius: 12px;
    border-left: 4px solid #FFB6C1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.rule-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.rule-text {
    margin: 0;
    line-height: 1.8;
    font-size: 15px;
    color: #333;
}

.rule-item.characters {
    background: linear-gradient(135deg, #E6F3FF 0%, #FFF0F5 100%);
    border-left: 4px solid #87CEEB;
    padding: 20px;
    display: block;
}

.character-title {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-family: 'Fredoka One', cursive;
    color: #FF6B6B;
    text-align: center;
}


.rule-text strong {
    color: #FF6B6B;
    font-weight: bold;
}

.rule-text strong.highlight {
    color: #FF6B6B;
    font-weight: bold;
}

.character-info {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.character-item {
    text-align: center;
    flex: 1;
    min-width: 150px;
}

.character-image {
    width: 80px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.character-name {
    margin: 0;
    font-size: 16px;
    font-family: 'Fredoka One', cursive;
    color: #333;
}

.character-name strong {
    color: #0066FF;
}

.character-item:last-child .character-name strong {
    color: #FF0000;
}

.character-description {
    margin: 0;
    line-height: 1.8;
    font-size: 14px;
    color: #555;
    text-align: center;
    padding-top: 10px;
    border-top: 2px dashed #FFB6C1;
}

.character-description strong {
    color: #FF6B6B;
    font-weight: bold;
}

#gamepadInfo {
    background: linear-gradient(135deg, #FFFFFF 0%, #F0F8FF 100%);
    border: 4px solid #FF6B6B;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 15px;
    max-width: 800px;
    font-size: 14px;
    display: flex;
    gap: 30px;
    align-items: flex-start;
    box-shadow: 
        0 10px 20px rgba(0, 0, 0, 0.2),
        0 0 0 3px #FFFFFF,
        0 0 0 6px #4ECDC4;
    position: relative;
}

#gamepadInfo::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(135deg, #FF6B6B, #4ECDC4, #FFE66D, #FF6B6B);
    border-radius: 25px;
    z-index: -1;
    opacity: 0.3;
}

.info-section {
    flex: 1;
    min-width: 0;
}

.info-section h2 {
    margin: 0 0 15px 0;
    font-size: 22px;
    font-family: 'Fredoka One', cursive;
    color: #FF6B6B;
    background: linear-gradient(135deg, #FFE66D 0%, #FF6B6B 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(255, 107, 107, 0.3);
    border-bottom: 3px solid #4ECDC4;
    padding-bottom: 8px;
    position: relative;
}

.info-section h2::after {
    content: '✨';
    margin-left: 8px;
    font-size: 18px;
}

#gamepadInfo ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

#gamepadInfo li {
    margin: 10px 0;
    line-height: 1.6;
    padding: 8px 12px;
    background: linear-gradient(135deg, #FFF9E6 0%, #FFFFFF 100%);
    border-radius: 12px;
    border-left: 4px solid #4ECDC4;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mapping-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.2),
        0 0 0 3px #FFFFFF,
        0 0 0 6px #FFE66D;
    border: 2px solid #4ECDC4;
}

#controlsLayout {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.controlSection {
    flex: 1;
}

.controlSection p {
    margin: 5px 0;
    font-weight: bold;
    color: #333;
}

.controlSection ul {
    margin: 5px 0;
    padding-left: 20px;
}

.icon-canvas {
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
    border: none;
    outline: none;
}


