* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    font-family: 'Arial', sans-serif;
    color: #FFD700;
}

.game-container {
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2),
        0 0 40px rgba(255, 215, 0, 0.1);
    border: 2px solid #FFD700;
    position: relative;
    overflow: hidden;
}

.game-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    animation: shine 4s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes shine {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.game-info,
.game-board,
.controls {
    position: relative;
    z-index: 2;
}

.game-info {
    margin-bottom: 20px;
    text-align: center;
    font-size: 28px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    font-weight: bold;
}

.game-board {
    width: 300px;
    height: 600px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(12, 1fr);
    gap: 2px;
    padding: 2px;
    border: 3px solid #B8860B;
    border-radius: 10px;
    box-shadow: inset 0 0 10px rgba(255, 215, 0, 0.3);
}

.cell {
    background: linear-gradient(145deg, #1a1a1a, #0a0a0a);
    border-radius: 50%;
    width: 100%;
    height: 100%;
    transition: background-color 0.2s;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
}

.puyo {
    width: 100%;
    height: 100%;
    transition: all 0.3s;
    position: relative;
    animation: squish 1s ease-in-out infinite;
    transform-origin: center center;
}

.puyo-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.puyo::after {
    content: '';
    position: absolute;
    top: 20%;
    left: 25%;
    width: 30%;
    height: 15%;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    transform: rotate(-45deg);
    filter: blur(2px);
    z-index: 2;
}

/* 上下左右の接続部分 */
.puyo.connect-top::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 25%;
    width: 50%;
    height: 50%;
    background: inherit;
    z-index: 1;
}

.puyo.connect-bottom::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: 25%;
    width: 50%;
    height: 50%;
    background: inherit;
    z-index: 1;
}

.puyo.connect-left::before {
    content: '';
    position: absolute;
    left: -50%;
    top: 25%;
    width: 50%;
    height: 50%;
    background: inherit;
    z-index: 1;
}

.puyo.connect-right::after {
    content: '';
    position: absolute;
    right: -50%;
    top: 25%;
    width: 50%;
    height: 50%;
    background: inherit;
    z-index: 1;
}

.puyo-inner.red {
    background: radial-gradient(circle at 30% 30%, #ff8888, #ff0000);
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 0 15px rgba(255, 0, 0, 0.5),
        0 0 10px rgba(255, 0, 0, 0.3);
}

.puyo-inner.blue {
    background: radial-gradient(circle at 30% 30%, #8888ff, #0000ff);
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 0 15px rgba(0, 0, 255, 0.5),
        0 0 10px rgba(0, 0, 255, 0.3);
}

.puyo-inner.green {
    background: radial-gradient(circle at 30% 30%, #88ff88, #00ff00);
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 0 15px rgba(0, 255, 0, 0.5),
        0 0 10px rgba(0, 255, 0, 0.3);
}

.puyo-inner.yellow {
    background: radial-gradient(circle at 30% 30%, #ffff88, #ffff00);
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 0 15px rgba(255, 255, 0, 0.5),
        0 0 10px rgba(255, 255, 0, 0.3);
}

@keyframes squish {

    0%,
    100% {
        transform: scale(1, 1);
    }

    50% {
        transform: scale(1.05, 0.95);
    }
}

@keyframes disappear {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }

    50% {
        transform: scale(1.2, 0.8) rotate(5deg);
    }

    100% {
        transform: scale(0) rotate(15deg);
        opacity: 0;
    }
}

.puyo.disappearing {
    animation: disappear 0.5s ease-out forwards;
}

.controls {
    margin-top: 20px;
    text-align: center;
}

#startButton {
    padding: 12px 30px;
    font-size: 20px;
    background: linear-gradient(145deg, #FFD700, #B8860B);
    color: #000;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

#startButton:hover {
    background: linear-gradient(145deg, #B8860B, #FFD700);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.particle {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    animation: particle 1s cubic-bezier(0.45, 0.05, 0.55, 0.95) forwards;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    opacity: 0.8;
}

@keyframes particle {
    0% {
        opacity: 0.8;
        transform: scale(1) rotate(0deg);
    }

    50% {
        opacity: 0.6;
        transform: scale(0.8) translate(var(--tx) * 0.5, var(--ty) * 0.5) rotate(180deg);
    }

    100% {
        opacity: 0;
        transform: scale(0) translate(var(--tx), var(--ty)) rotate(360deg);
    }
}

.particle.red {
    background: radial-gradient(circle at 30% 30%, #ffaaaa, #ff6666);
    filter: blur(1px);
}

.particle.blue {
    background: radial-gradient(circle at 30% 30%, #aaaaff, #6666ff);
    filter: blur(1px);
}

.particle.green {
    background: radial-gradient(circle at 30% 30%, #aaffaa, #66ff66);
    filter: blur(1px);
}

.particle.yellow {
    background: radial-gradient(circle at 30% 30%, #ffffaa, #ffff66);
    filter: blur(1px);
}