body { margin: 0; overflow: hidden; font-family: 'Press Start 2P', monospace !important; color: white !important; background-color: #0d0b14; -webkit-tap-highlight-color: transparent; touch-action: manipulation; -webkit-user-select: none; user-select: none; background-size: cover; background-position: center; background-repeat: no-repeat; }
#game-container { position: relative; width: 100vw; height: 100vh; overflow: hidden; display: flex; justify-content: center; align-items: center; }
body.debug-mode-active #game-container { box-shadow: inset 0 0 0 3px red; }
#vignette-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; box-shadow: inset 0 0 150px rgba(0,0,0,0.7); pointer-events: none; z-index: 100; }
#flash-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: white; z-index: 500; pointer-events: none; opacity: 0; }
.hidden { display: none !important; }
#matter-container { position: relative; z-index: 2; }
#matter-container canvas { display: block; }
.ui { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; flex-direction: column; text-align: center; justify-content: center; align-items: center; z-index: 200; }
@keyframes background-pan { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
#start-menu { gap: 20px; background: linear-gradient(225deg, #1d2b3a, #4a1a3a, #2c3e50, #0d0b14); background-size: 400% 400%; animation: background-pan 25s ease infinite; position: relative; overflow: hidden; }
#title-animation-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
#game-screen-wrapper { display: flex;  justify-content: center;  align-items: center; position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

#ranking-display {
    flex-grow: 1;
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90%;
    max-width: 480px;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background-color: rgba(0, 0, 0, 0.2);
}

@keyframes screen-shake {
  0%, 100% { transform: translate(0, 0); }
  10%, 30%, 50%, 70%, 90% { transform: translate(-5px, 5px) rotate(-1deg); }
  20%, 40%, 60%, 80% { transform: translate(5px, -5px) rotate(1deg); }
}
.screen-shake { animation: screen-shake 0.4s cubic-bezier(.36,.07,.19,.97) both; }

@keyframes red-border-flash {
  from { box-shadow: inset 0 0 0 0px rgba(255, 0, 0, 0.7); }
  50% { box-shadow: inset 0 0 0 20px rgba(255, 0, 0, 0.7); }
  to { box-shadow: inset 0 0 0 0px rgba(255, 0, 0, 0.7); }
}
.red-flash-border { animation: red-border-flash 0.5s ease-out both; }

@keyframes anaglyph-move {
  0%, 100% { text-shadow: -2px -2px 0 #ff0000, 2px 2px 0 #00ffff; }
  25% { text-shadow: 2px -2px 0 #ff0000, -2px 2px 0 #00ffff; }
  50% { text-shadow: 2px 2px 0 #ff0000, -2px -2px 0 #00ffff; }
  75% { text-shadow: -2px 2px 0 #ff0000, 2px -2px 0 #00ffff; }
}

#title-graphic, #game-over-title {
  color: #f0f0f0;
  text-shadow: -2px -2px 0 #ff0000, 2px 2px 0 #00ffff;
  animation: anaglyph-move 1.5s linear infinite;
}

#title-graphic {
    font-size: clamp(38px, 9vw, 70px);
    margin-bottom: 20px;
    margin-top: 20px;
    line-height: 1.2;
    text-transform: uppercase;
}

#game-over-title {
    font-size: clamp(45px, 11vw, 90px);
    margin-bottom: 20px;
}

#start-menu .button { transition: all 0.3s ease; }
#start-menu .button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.4), inset 0 -2px 5px rgba(0,0,0,0.3), inset 0 2px 2px rgba(255,255,255,0.2), 0 0 15px rgba(169, 114, 255, 0.8), 0 0 25px rgba(169, 114, 255, 0.6);
}

#game-over-screen, #pause-screen, #design-menu, #share-modal { background-color: rgba(0,0,0,0.7); }
.modal-content { background-color: rgba(44, 42, 60, 0.9); border: 2px solid #a972ff; border-radius: 15px; box-shadow: 0 0 20px rgba(169, 114, 255, 0.5); max-width: 95%; width: 600px; padding: 20px 30px; box-sizing: border-box; margin: auto; position: relative; }
.button-container { display: flex; justify-content: center; flex-wrap: wrap; }
.button { font-family: inherit; font-size: clamp(14px, 2.5vw, 20px); padding: 15px 30px; margin: 10px; border-radius: 50px; cursor: pointer; background: linear-gradient(145deg, #5c62c2, #494ead); border: none; color: #fff; text-shadow: 0 0 5px #fff, 1px 1px 2px rgba(0,0,0,0.7); position: relative; transition: all 0.3s ease-out; overflow: hidden; box-shadow: 0 5px 15px rgba(0,0,0,0.4), inset 0 -2px 5px rgba(0,0,0,0.3), inset 0 2px 2px rgba(255,255,255,0.2); }
#game-ui-overlay { pointer-events: none; justify-content: space-between; height: 100%; width: 100%; }
#game-top-bar { pointer-events: auto; width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 10px; box-sizing: border-box; height: 80px; }
.ingame-buttons-left { display: flex; align-items: center; gap: 15px; }
.ingame-buttons-right { position: relative; display: flex; align-items: center; gap: 15px; }
#pause-button, #mobile-debug-toggle, #ingame-fullscreen-button { background: none; border: none; font-size: 24px; cursor: pointer; padding: 0; color: white; }
#ingame-fullscreen-button { line-height: 1; }
.mobile-debug-options { position: absolute; top: 100%; right: 0; background-color: rgba(0, 0, 0, 0.7); border-radius: 5px; padding: 5px; display: flex; flex-direction: column; gap: 5px; }
.debug-button { font-size: 14px !important; font-family: monospace !important; border: 1px solid #fff !important; padding: 5px 8px !important; border-radius: 5px; margin: 0 !important; background-color: rgba(255, 255, 255, 0.2); }
#game-bottom-bar { width: 100%; pointer-events: auto; background-color: transparent; padding: 10px; box-sizing: border-box; }
#next-bubble-preview { width: 40px; height: 40px; background-color: rgba(0,0,0,0.3); border: 2px solid #fff; border-radius: 50%; background-size: contain; background-position: center; background-repeat: no-repeat; }
#next-bubble-container { display: flex; align-items: center; gap: 8px; }
.settings-option { width: 100%; display: flex; justify-content: space-between; align-items: center; margin: 15px 0; font-size: 1.2em; }
.setting-row { width: 100%; display: flex; align-items: center; margin: 10px 0 20px; }
.toggle-switch { position: relative; display: inline-block; width: 60px; height: 34px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 26px; width: 26px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #2196F3; }
input:checked + .slider:before { transform: translateX(26px); }
.modal-close-button { position: absolute; top: 15px; right: 20px; width: 40px; height: 40px; background: none; border: none; font-size: 30px; color: white; cursor: pointer; line-height: 40px; text-align: center; padding: 0; opacity: 0.7; transition: opacity 0.2s, transform 0.2s; z-index: 10; }
.modal-close-button:hover { opacity: 1; transform: rotate(90deg); }
.modal-close-button::before { content: '\00d7'; font-weight: bold; }
#debug-menu .modal-content, #design-menu .modal-content { max-height: 80vh; overflow-y: auto; }
#close-design-menu { margin-top: 20px; }
#quality-selector-container { display: flex; gap: 10px; }
.quality-button { padding: 8px 16px !important; font-size: 14px !important; background: #4a4a70; box-shadow: none; }
.quality-button.selected { background: linear-gradient(145deg, #5c62c2, #494ead); box-shadow: 0 5px 15px rgba(0,0,0,0.4), inset 0 -2px 5px rgba(0,0,0,0.3), inset 0 2px 2px rgba(255,255,255,0.2); transform: scale(1.05); }
.share-options { display: flex; flex-direction: column; gap: 15px; margin: 20px 0; width: 80%; }
.share-option { display: block; padding: 15px; background-color: #4a4a70; color: white; text-decoration: none; border-radius: 10px; transition: background-color 0.2s; font-size: 16px; }
.share-option:hover { background-color: #5c62c2; }
@media (orientation: landscape) { #debug-menu { justify-content: center; align-items: flex-end; } #debug-menu .modal-content { margin: 20px; width: 450px; max-height: 95vh; } }
.debug-slider-group { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.debug-slider-group .preview-img { width: 30px; height: 30px; background-size: contain; background-position: center; background-repeat: no-repeat; border-radius: 50%; border: 1px solid #fff; }
.debug-slider-group label { flex-basis: 120px; text-align: left; font-size: 12px; }
.debug-slider-group .value-display { font-size: 12px; min-width: 45px; text-align: right; }
#bubble-selector { display: none; justify-content: center; align-items: center; width: 100%; gap: 1vw; }
.bubble-selector-icon { width: 7vw; height: 7vw; max-width: 40px; max-height: 40px; background-size: contain; background-position: center; background-repeat: no-repeat; border: 2px solid #fff; border-radius: 50%; cursor: pointer; transition: transform 0.2s; }
.bubble-selector-icon:hover { transform: scale(1.1); border-color: #ffc107; }
#bottom-ad-container { position: fixed; bottom: 0; left: 0; width: 100%; height: 50px; z-index: 150; display: flex; justify-content: center; align-items: center; background-color: #000; padding-bottom: env(safe-area-inset-bottom); box-sizing: content-box; }
#overlay-ad-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.8); z-index: 9999; display: flex; justify-content: center; align-items: flex-end; padding-bottom: 50px; box-sizing: border-box; }
#close-overlay-ad-button { position: absolute; top: 15px; right: 20px; background: none; border: none; color: white; font-size: 40px; font-weight: bold; cursor: pointer; text-shadow: 0 0 5px black; }
#overlay-ad-content { position: relative; }
#game-over-image-container { position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 4; pointer-events: none; }
#game-over-image { width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }
.design-section-container { width: 100%; margin-top: 20px; padding-top: 15px; border-top: 1px solid #fff; }
.items-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 15px; }
.design-option { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.preview-box { width: 80px; height: 80px; border: 2px solid #fff; background-size: cover; background-position: center; }
.design-button-container { display: flex; gap: 10px; }
.button.share-button { background: linear-gradient(145deg, #28a745, #218838); }
#player-name-container { margin-bottom: 20px; }
#ranking-list { list-style-type: none; padding-left: 0; width: 100%; }
#ranking-list li { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; }
.rank-part { flex-basis: 15%; text-align: center; }
.name-part { flex-grow: 1; text-align: left; padding-left: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score-part { flex-basis: 35%; text-align: right; }

@keyframes gameplay-gradient-animation { 0% { background-position: 50% 0%; } 50% { background-position: 50% 100%; } 100% { background-position: 50% 0%; } }
#matter-container.aurora-background { background: linear-gradient(180deg, #1d1a2f, #3b2a55, #6d3b6d, #a8527a); background-size: 100% 300%; animation: gameplay-gradient-animation 20s ease infinite; }

#start-button.primary-action {
  width: 90%; /* 80%から90%に変更 */
  max-width: 400px;
  padding-top: 20px;
  padding-bottom: 20px;
  font-size: clamp(20px, 4vw, 28px);
  background: linear-gradient(145deg, #3cacd7, #2d8cb3);
  border: none;
  box-shadow: 0 5px 15px rgba(0,0,0,0.4), inset 0 -2px 5px rgba(0,0,0,0.3), inset 0 2px 2px rgba(255,255,255,0.2);
  white-space: nowrap; /* この行を追加 */
}
#start-button.primary-action:hover { background: linear-gradient(145deg, #4cbbe0, #3a98bb); }
#open-debug-menu-button { background: linear-gradient(145deg, #ac3535, #912b2b); }
#open-debug-menu-button:hover { background: linear-gradient(145deg, #c04343, #a13838); }

#evolution-order { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px; padding: 10px; background-color: rgba(0,0,0,0.2); border-radius: 8px; }
#evolution-order img { width: clamp(28px, 6vw, 40px); height: clamp(28px, 6vw, 40px); }
#evolution-order .arrow { font-size: clamp(16px, 4vw, 20px); color: #ccc; }
#game-tips { text-align: left; padding-left: 25px; font-size: clamp(12px, 2.5vw, 16px); line-height: 1.6; }
#game-tips li { margin-bottom: 8px; }

#privacy-policy-section { margin-top: 20px; padding-top: 15px; border-top: 1px solid rgba(255, 255, 255, 0.2); }
.policy-text-container { font-family: sans-serif; font-size: 12px; line-height: 1.5; text-align: left; color: #ddd; padding: 10px; background-color: rgba(0,0,0,0.2); border-radius: 5px; max-height: 200px; overflow-y: auto; }
.policy-text-container p { margin-top: 0; margin-bottom: 10px; }
.policy-text-container ul { margin: 10px 0; padding-left: 20px; }
.policy-text-container a { color: #87cefa; text-decoration: underline; }

@keyframes slideOutUp { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-100%); opacity: 0; } }
@keyframes slideInUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.slide-out-up { animation: slideOutUp 0.5s forwards ease-in-out; pointer-events: none; }
.slide-in-up { animation: slideInUp 0.5s forwards ease-in-out; }

#settings-modal, #how-to-play-modal { background-color: transparent; transition: background-color 0.3s ease-in-out; }
#settings-modal .modal-content, #how-to-play-modal .modal-content { transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); }
#settings-modal:not(.active), #how-to-play-modal:not(.active) { pointer-events: none; }
#settings-modal .modal-content { transform: translateX(-120%); }
#how-to-play-modal .modal-content { transform: translateX(120%); }
#settings-modal.active, #how-to-play-modal.active { background-color: rgba(0,0,0,0.7); }
#settings-modal.active .modal-content, #how-to-play-modal.active .modal-content { transform: translateX(0); }
#settings-modal .modal-content, #how-to-play-modal .modal-content { max-height: 80vh; overflow-y: auto; }