/* --- CSS: 全体設定とデザイン --- */
:root {
    --cyber-blue: #00e5ff;
    --dark-bg: #121218;
    --metal-bg: #2a2a32;
    --metal-border: #444;
    --text-color: #f0f0f0;
    --highlight-red: #ff3b30;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent; /* スマホタップ時のハイライトを消す */
}

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Noto Sans JP', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-color);
    overflow: hidden;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background-image:
        linear-gradient(rgba(18, 18, 24, 0.8), rgba(18, 18, 24, 0.8)),
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><g fill="%231a1a20"><rect width="100" height="100" /></g><g fill="%23222228" fill-opacity="0.6"><path d="M0 50 L50 0 L100 50 L50 100 Z" /></g></svg>');
}

#game-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    background: linear-gradient(145deg, #333, #1e1e24);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 229, 255, 0.2), inset 0 2px 4px rgba(255,255,255,0.1);
    border: 1px solid var(--metal-border);
    text-align: center;
}

.header {
    margin-bottom: 25px;
}

.header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    color: var(--cyber-blue);
    text-shadow: 0 0 10px var(--cyber-blue), 0 0 20px var(--cyber-blue);
    letter-spacing: 2px;
}

.header p {
    font-size: 0.85rem;
    color: #aaa;
    margin-top: 4px;
}

#slot-machine {
    display: flex;
    justify-content: space-around;
    gap: 12px;
    padding: 15px;
    background: #111;
    border-radius: 10px;
    border: 2px solid var(--metal-border);
    box-shadow: inset 0 0 15px rgba(0,0,0,0.7);
    position: relative;
}

#slot-machine::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 120px; /* アイテムの高さに合わせる */
    transform: translateY(-50%);
    background: rgba(0, 229, 255, 0.1);
    border-top: 2px solid var(--cyber-blue);
    border-bottom: 2px solid var(--cyber-blue);
    z-index: 2;
}

.reel {
    width: 110px;
    height: 120px;
    background-color: var(--metal-bg);
    border: 1px solid #000;
    overflow: hidden;
    position: relative;
}

.reel-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.reel-inner.spinning {
    animation: spin 0.2s linear infinite;
}

@keyframes spin {
    from { transform: translateY(0); }
    to { transform: translateY(-240px); } /* 画像2枚分動かすとループする */
}

.reel-inner img {
    width: 100px;
    height: 100px;
    display: block;
    margin: 10px auto;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
}

#controls {
    margin-top: 30px;
}

#spin-button {
    width: 85%;
    padding: 18px 0;
    font-size: 1.8rem;
    font-weight: bold;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    color: var(--text-color);
    border: none;
    border-radius: 12px;
    transition: all 0.1s ease-in-out;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

#spin-button.state-spin {
    background: linear-gradient(145deg, var(--highlight-red), #c02d25);
    box-shadow: 0 6px 0 #8b1f18, 0 8px 15px rgba(0,0,0,0.5);
}

#spin-button.state-spin:active:not(:disabled) {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #8b1f18;
}

#spin-button.state-stop {
    background: linear-gradient(145deg, var(--cyber-blue), #00a8c0);
    box-shadow: 0 6px 0 #007a8b, 0 8px 15px rgba(0,0,0,0.5);
}

#spin-button.state-stop:active:not(:disabled) {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #007a8b;
}

#spin-button:disabled {
    background: #555;
    color: #999;
    cursor: not-allowed;
    box-shadow: 0 6px 0 #333;
}

/* --- モーダルウィンドウ --- */
#modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none; justify-content: center; align-items: center;
    z-index: 100; padding: 1rem; opacity: 0; transition: opacity 0.3s ease;
}
#modal.show { display: flex; opacity: 1; }
.modal-content {
    background: var(--metal-bg); padding: 25px; border-radius: 16px;
    border: 1px solid var(--cyber-blue); box-shadow: 0 0 30px rgba(0, 229, 255, 0.5);
    width: 100%; max-width: 450px; text-align: center;
    animation: modal-pop 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
@keyframes modal-pop { 0% { transform: scale(0.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
#modal-prize-name { font-family: 'Orbitron', sans-serif; font-size: 1.8rem; color: var(--cyber-blue); margin-bottom: 10px; text-shadow: 0 0 5px var(--cyber-blue); }
#modal-prize-item { font-size: 1.2rem; font-weight: bold; margin-bottom: 15px; }
#modal-item-image { width: 120px; height: 120px; margin: 0 auto 15px; border-radius: 10px; background: #fff; }
#modal-item-description { font-size: 0.9rem; color: #ccc; line-height: 1.6; margin-bottom: 25px; text-align: left; border-top: 1px solid var(--metal-border); padding-top: 15px; }
.share-buttons { display: flex; justify-content: center; gap: 15px; margin-bottom: 20px; }
.share-button { display: inline-block; padding: 10px 20px; border-radius: 8px; text-decoration: none; color: #fff; font-weight: bold; font-size: 0.9rem; transition: transform 0.2s; }
.share-button:hover { transform: scale(1.05); }
.twitter-share { background-color: #1DA1F2; }
.line-share { background-color: #06C755; }
#modal-close-button { padding: 10px 30px; background: #555; border: none; border-radius: 8px; color: white; cursor: pointer; font-size: 1rem; }