
/* ============================================
   チンチロ - style.css
   ============================================ */

* { box-sizing: border-box; }

body {
    font-family: 'Yuji Syuku', serif;
    margin: 0;
    background: radial-gradient(circle, #2e7d32 0%, #1b5e20 100%);
    color: #fff;
    text-align: center;
    overflow-x: hidden;
    touch-action: manipulation;
    user-select: none;
    height: 100vh;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
}

button {
    font-family: inherit;
    font-size: 15px;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.1s, opacity 0.3s;
    margin: 3px;
}
button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary { background: linear-gradient(135deg, #d32f2f, #b71c1c); color: #fff; }
.btn-secondary { background: linear-gradient(135deg, #1976d2, #0d47a1); color: #fff; }
.btn-danger { background: #555; color: #fff; }

h2 { margin: 5px 0; font-size: 22px; }
p { margin: 5px 0; }

/* ========== START SCREEN ========== */
.start-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #000;
    z-index: 20000;
    cursor: pointer;
}

.start-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.55) 0%,
        rgba(0, 0, 0, 0.10) 40%,
        rgba(0, 0, 0, 0.10) 70%,
        rgba(0, 0, 0, 0.60) 100%
    );
    z-index: 1;
}

.title-main {
    position: absolute;
    top: 6%;
    width: 100%;
    text-align: center;
    z-index: 2;
    font-family: 'Kaisei HarunoUmi', 'Noto Serif JP', serif;
    font-size: clamp(3rem, 10vw, 5.5rem);
    font-weight: 900;
    color: #FFD700;
    text-shadow:
        -3px -3px 0 #000, 3px -3px 0 #000,
        -3px  3px 0 #000, 3px  3px 0 #000,
         0   -3px 0 #000, 0    3px 0 #000,
        -3px  0   0 #000, 3px  0   0 #000,
         0 0 15px rgba(255, 0, 0, 0.8),
         0 0 30px rgba(255, 0, 0, 0.5),
         0 0 60px rgba(255, 0, 0, 0.3);
    transform: rotate(-3deg) skewX(-2deg);
    letter-spacing: 0.15em;
    animation: titlePulse 2s ease-in-out infinite;
}

.title-sub {
    position: absolute;
    top: 18%;
    width: 100%;
    text-align: center;
    z-index: 2;
    font-family: 'Kaisei HarunoUmi', 'Noto Serif JP', serif;
    font-size: clamp(1.5rem, 5vw, 3rem);
    font-weight: 700;
    color: #FFFFFF;
    text-shadow:
        -2px -2px 0 #8B0000, 2px -2px 0 #8B0000,
        -2px  2px 0 #8B0000, 2px  2px 0 #8B0000,
         0 0 10px rgba(255, 50, 50, 0.6),
         0 0 20px rgba(255, 0, 0, 0.3);
    letter-spacing: 0.3em;
    transform: rotate(-3deg);
}

.tap-to-start {
    position: absolute;
    bottom: 12%;
    width: 100%;
    text-align: center;
    z-index: 2;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: clamp(1rem, 3.5vw, 1.6rem);
    font-weight: 600;
    color: #FFFFFF;
    text-shadow:
        0 0 8px rgba(0, 0, 0, 0.9),
        0 0 20px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.2em;
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% {
        transform: rotate(-3deg) skewX(-2deg) scale(1);
        text-shadow:
            -3px -3px 0 #000, 3px -3px 0 #000,
            -3px  3px 0 #000, 3px  3px 0 #000,
             0 -3px 0 #000, 0 3px 0 #000,
            -3px 0 0 #000, 3px 0 0 #000,
             0 0 15px rgba(255,0,0,0.8),
             0 0 30px rgba(255,0,0,0.5);
    }
    50% {
        transform: rotate(-3deg) skewX(-2deg) scale(1.05);
        text-shadow:
            -3px -3px 0 #000, 3px -3px 0 #000,
            -3px  3px 0 #000, 3px  3px 0 #000,
             0 -3px 0 #000, 0 3px 0 #000,
            -3px 0 0 #000, 3px 0 0 #000,
             0 0 25px rgba(255,0,0,1),
             0 0 50px rgba(255,0,0,0.7),
             0 0 80px rgba(255,50,0,0.4);
    }
}



/* ========== TITLE SCREEN ========== */
#title-screen {
    background: url('assets/images/title.webp') center/cover no-repeat;
    background-color: #2e7d32;
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    display: none; flex-direction: column; justify-content: center; align-items: center;
    z-index: 10;
}
#title-screen::before {
    content: "";
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.65);
    z-index: -1;
}
#title-screen h1,
#title-screen p,
#title-screen input,
#title-screen button {
    position: relative; z-index: 1;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.9);
}

#title-screen-top {
    position: relative; z-index: 1;
    display: flex; justify-content: center; align-items: center;
    width: 100%; max-width: 300px; margin-bottom: 20px;
}

#settings-btn {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    padding: 10px 20px; font-size: 18px;
}

/* ========== SETTINGS MODAL ========== */
#settings-modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); z-index: 15000;
    justify-content: center; align-items: center;
}
.settings-box {
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    padding: 30px; border-radius: 15px; width: 85%; max-width: 350px;
    border: 3px solid #ffd700;
    box-shadow: 0 8px 32px rgba(0,0,0,0.8);
}
.settings-box h2 {
    color: #ffd700; margin-top: 0; font-size: 28px;
    border-bottom: 2px solid #ffd700; padding-bottom: 15px;
}
.volume-control { margin: 20px 0; text-align: left; }
.volume-control label {
    display: block; font-size: 16px; margin-bottom: 8px;
    color: #fff; font-weight: bold;
}
.volume-control input[type="range"] {
    width: 100%; height: 8px; border-radius: 5px; outline: none;
    background: linear-gradient(to right, #d32f2f, #ffd700);
}
.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 20px; height: 20px;
    border-radius: 50%; background: #ffd700; cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.volume-control input[type="range"]::-moz-range-thumb {
    width: 20px; height: 20px; border-radius: 50%; background: #ffd700;
    cursor: pointer; border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.volume-control input[type="range"]::-moz-range-track {
    background: transparent; border: none;
}
.volume-value {
    display: inline-block; margin-left: 10px;
    color: #ffd700; font-weight: bold;
}
.settings-close-btn { margin-top: 20px; width: 100%; }

/* ========== LOBBY / GAME / RESULT SCREENS ========== */
#lobby-screen,
#game-board,
#result-board,
#parent-selection-screen {
    display: none;
    padding: 10px;
    flex: 1;
    flex-direction: column;
    justify-content: flex-start;
}

/* ========== PARENT SELECTION ========== */
#parent-selection-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, #2e7d32 0%, #1b5e20 100%);
    justify-content: center; align-items: center;
    z-index: 100;
    flex-direction: column;
}

.parent-selection-content {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #ffd700;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 90%;
}

.parent-selection-content h2 {
    color: #ffd700;
    margin-top: 0;
    font-size: 24px;
    border-bottom: 2px solid rgba(255, 215, 0, 0.4);
    padding-bottom: 15px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9);
}

#parent-selection-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 20px 0;
}

.parent-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 215, 0, 0.4);
    color: #fff;
    padding: 18px 10px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Yuji Syuku', serif;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.parent-btn:hover {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.15);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
    transform: scale(1.03);
}

.parent-btn:active {
    transform: scale(0.97);
}

/* ========== ゲーム画面ヘッダー ========== */

/* ゲーム画面ヘッダー */
.top-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    padding-top: 15px;
    padding-right: 55px;
}

/* 設定ボタン右上固定 */
#settings-btn {
    position: fixed;
    top: 15px;
    right: 10px;
    z-index: 9999;
    background: linear-gradient(135deg, #ff9800, #f57c00);
    padding: 10px 15px;
    font-size: 18px;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ゲーム画面全体 */
#game-board {
    padding: 15px 10px 20px 10px;
}

/* 賭けボタン・アクションボタン周り */
#action-controls {
    margin-top: 5px;
    margin-bottom: 15px;
}

#bet-controls {
    margin-bottom: 15px;
}

/* 観戦メッセージ */
#observer-msg {
    margin-bottom: 15px;
}




/* ========== HOST SETTINGS ========== */
#host-settings-panel {
    background: rgba(0,0,0,0.7);
    border: 2px solid #ffd700; border-radius: 10px;
    padding: 15px; margin: 10px 0;
    display: none;
}
#host-settings-panel h3 {
    color: #ffd700; margin-top: 0; font-size: 18px;
}
.setting-item { margin: 12px 0; text-align: left; }
.setting-item label {
    display: block; font-size: 14px; margin-bottom: 5px; color: #fff;
}
.setting-item input[type="number"] {
    width: 120px; padding: 6px; font-size: 14px;
    border-radius: 5px; border: none;
}
.mode-buttons { display: flex; gap: 10px; margin: 10px 0; }
.mode-btn {
    flex: 1; padding: 10px; font-size: 14px;
    border-radius: 8px; border: 2px solid transparent;
    cursor: pointer; transition: all 0.3s;
}
.mode-btn.active {
    border-color: #ffd700;
    background: rgba(255,215,0,0.3);
}

/* ========== GAME LOG ========== */
#game-log {
    background: rgba(0,0,0,0.6);
    border: 2px solid #d32f2f; border-radius: 8px;
    height: 60px; overflow-y: auto;
    padding: 5px 10px; margin: 5px auto;
    width: 95%; max-width: 400px;
    font-size: 12px; text-align: left;
}

.status-bar {
    display: flex; justify-content: space-around;
    background: rgba(0,0,0,0.5);
    padding: 5px 10px; border-radius: 8px;
    margin-bottom: 5px; font-size: 15px;
}
.pot-text {
    color: #ffd700; font-size: 20px;
    font-weight: bold; margin: 5px 0;
}

/* ========== DICE ========== */
#dice-container {
    display: flex; justify-content: center; align-items: center;
    gap: 10px; margin: 10px 0; min-height: 70px;
}
.dice {
    width: 65px; height: 65px; border-radius: 8px;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.5);
    background-color: #fff;
    transition: opacity 0.5s;
}
.front-element {
    position: relative;
    z-index: 9600 !important;
}

.rolling-effect { animation: shake 0.3s infinite; }
@keyframes shake {
    0%   { transform: translate(1px,1px) rotate(0deg); }
    10%  { transform: translate(-1px,-2px) rotate(-1deg); }
    20%  { transform: translate(-3px,0px) rotate(1deg); }
    30%  { transform: translate(3px,2px) rotate(0deg); }
    40%  { transform: translate(1px,-1px) rotate(1deg); }
    50%  { transform: translate(-1px,2px) rotate(-1deg); }
    60%  { transform: translate(-3px,1px) rotate(0deg); }
    70%  { transform: translate(3px,1px) rotate(-1deg); }
    80%  { transform: translate(-1px,-1px) rotate(1deg); }
    90%  { transform: translate(1px,2px) rotate(0deg); }
    100% { transform: translate(1px,-2px) rotate(-1deg); }
}

/* ========== HAND DISPLAY ========== */
#hand-display {
    font-size: 22px; margin: 5px 0; min-height: 40px;
    display: flex; justify-content: center; align-items: center;
}
.gold-text {
    background: linear-gradient(to bottom, #FFF7A8 0%, #FFDF00 40%, #D4AF37 60%, #996515 100%);
    -webkit-background-clip: text; background-clip: text;
    color: transparent; font-weight: bold; display: inline-block;
    -webkit-text-stroke: 2px #000;
    filter: drop-shadow(3px 3px 3px rgba(0,0,0,0.8));
}
.shonben-text {
    font-size: 32px; color: #4fc3f7;
    text-shadow: 2px 2px 4px #000;
    animation: blink 0.5s infinite;
}
@keyframes blink {
    0%   { opacity: 1; }
    50%  { opacity: 0.5; }
    100% { opacity: 1; }
}

/* ========== YOUR TURN NOTICE ========== */
#your-turn-notice {
    display: none; position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000; padding: 20px 40px; border-radius: 20px;
    font-size: 28px; font-weight: bold;
    z-index: 9700;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    animation: pop-in 0.5s ease-out;
    white-space: nowrap;
}
@keyframes pop-in {
    0%   { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* ========== PINZORO BACKGROUND ========== */
#pinzoro-bg {
    display: none; position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 9500;
    background: linear-gradient(45deg, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
    animation: hueRainbow 1.5s linear infinite;
    opacity: 0; transition: opacity 0.5s;
}
@keyframes hueRainbow {
    0%   { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* ========== IRIS WIPE ========== */
.iris-wipe {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #000; z-index: 9000;
    pointer-events: none; opacity: 0;
    transition: opacity 0.5s ease-in-out;
}
.iris-closed { opacity: 1; }

/* ========== MODALS ========== */
#player-list-modal,
#custom-modal-overlay {
    display: none; position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); z-index: 8000;
    justify-content: center; align-items: center;
}
#custom-modal-overlay { z-index: 10000; }

.modal-content,
#custom-modal-box {
    background: #333; padding: 20px; border-radius: 10px;
    width: 80%; max-width: 300px; text-align: left;
}
#custom-modal-box {
    background: #2e7d32;
    border: 2px solid #ffeb3b;
    text-align: center;
}
.modal-content li {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px; border-bottom: 1px solid #555; padding-bottom: 5px;
}

#action-controls { margin-top: 5px; }

/* ========== DESTINY SECTION ========== */
#destiny-section {
    display: none; position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.95);
    border: 3px solid #ff6b00; padding: 30px;
    border-radius: 20px; z-index: 9700;
    text-align: center; max-width: 85%; color: #fff;
}
#destiny-section p {
    font-size: 20px; margin-bottom: 20px;
    color: #ffeb3b; font-weight: bold;
}
#destiny-section button {
    font-size: 18px; padding: 10px 30px; margin: 5px;
}

/* ========== BATTLE RESULT ========== */
#battle-result {
    display: none; position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.95);
    border: 3px solid #ffd700; padding: 30px;
    border-radius: 20px; z-index: 9700;
    text-align: center; max-width: 85%;
}
#battle-result h2 {
    color: #ffd700; font-size: 32px; margin: 10px 0;
}
#battle-result p {
    font-size: 18px; margin: 10px 0; color: #fff;
}
.result-win  { color: #4caf50; font-weight: bold; }
.result-lose { color: #f44336; font-weight: bold; }
.result-draw { color: #ff9800; font-weight: bold; }

/* ========== AFK ========== */
#afk-countdown {
    color: #ff5552; font-weight: bold; font-size: 18px;
    min-height: 25px; white-space: nowrap; padding: 5px;
}

/* ========== DICE REVEAL ANIMATION ========== */
.dice-hidden {
    opacity: 0 !important;
    transform: scale(0.3);
    transition: opacity 0.4s, transform 0.4s;
}
.dice-reveal {
    opacity: 1 !important;
    transform: scale(1);
    transition: opacity 0.4s, transform 0.4s;
}

/* ========== DESTINY NOISE EFFECT ========== */
#destiny-noise {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 9800;
    pointer-events: none;
}

#destiny-noise.active {
    display: block;
    animation: glitch-shake 0.05s infinite;
}

#noise-canvas {
    width: 100%;
    height: 100%;
}

/* 画面全体がガタガタ揺れる */
@keyframes glitch-shake {
    0%   { transform: translate(8px, -5px) skewX(2deg); }
    10%  { transform: translate(-6px, 7px) skewX(-3deg); }
    20%  { transform: translate(10px, 3px) skewY(1deg); }
    30%  { transform: translate(-8px, -8px) skewX(4deg); }
    40%  { transform: translate(5px, 6px) skewY(-2deg); }
    50%  { transform: translate(-10px, -3px) skewX(-5deg); }
    60%  { transform: translate(7px, 9px) skewX(3deg); }
    70%  { transform: translate(-5px, -6px) skewY(4deg); }
    80%  { transform: translate(9px, 4px) skewX(-2deg); }
    90%  { transform: translate(-7px, 7px) skewY(-3deg); }
    100% { transform: translate(6px, -8px) skewX(5deg); }
}

/* ノイズ中は画面本体もグリッチ */
body.glitching {
    animation: body-glitch 0.1s infinite;
}

@keyframes body-glitch {
    0%   { filter: hue-rotate(0deg) saturate(1); }
    20%  { filter: hue-rotate(90deg) saturate(5) brightness(1.5); }
    40%  { filter: hue-rotate(180deg) saturate(0.2) contrast(2); }
    60%  { filter: hue-rotate(270deg) saturate(8) brightness(0.5); }
    80%  { filter: hue-rotate(45deg) saturate(3) invert(1); }
    100% { filter: hue-rotate(0deg) saturate(1); }
}

/* グリッチバー（横線が走る） */
#destiny-noise::before,
#destiny-noise::after {
    content: "";
    position: absolute;
    left: 0; width: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 1;
    animation: glitch-bar 0.08s infinite;
}

#destiny-noise::before {
    height: 3px;
    animation: glitch-bar-1 0.06s infinite;
}

#destiny-noise::after {
    height: 8px;
    animation: glitch-bar-2 0.09s infinite;
}

@keyframes glitch-bar-1 {
    0%   { top: 10%; opacity: 1; }
    25%  { top: 65%; opacity: 0; }
    50%  { top: 30%; opacity: 1; }
    75%  { top: 80%; opacity: 0; }
    100% { top: 45%; opacity: 1; }
}

@keyframes glitch-bar-2 {
    0%   { top: 70%; opacity: 0.8; }
    20%  { top: 15%; opacity: 0; }
    40%  { top: 55%; opacity: 1; }
    60%  { top: 5%;  opacity: 0; }
    80%  { top: 85%; opacity: 0.8; }
    100% { top: 35%; opacity: 1; }
}


/* ========== 設定ボタン右上固定 ========== */
#settings-btn {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 9999;
    background: linear-gradient(135deg, #ff9800, #f57c00);
    padding: 10px 15px;
    font-size: 18px;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ========== 待機室プレイヤーリスト ========== */
#lobby-players {
    list-style: none;
    padding: 0;
    width: 90%;
    max-width: 350px;
    margin: 10px auto;
}

#lobby-players li {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 10px;
    padding: 12px 20px;
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

#lobby-players li::before {
    content: "🎲";
    font-size: 20px;
}

#lobby-players li:first-child {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.15);
}

#lobby-players li:first-child::after {
    content: "👑 ホスト";
    margin-left: auto;
    font-size: 12px;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.2);
    padding: 2px 8px;
    border-radius: 5px;
}


/* ========== ラウンド役一覧パネル ========== */
#round-hands-panel {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 8px;
    padding: 8px 10px;
    margin: 5px auto;
    width: 95%;
    max-width: 400px;
    font-size: 13px;
    text-align: left;
}

#round-hands-header {
    color: #ffd700;
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 5px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    padding-bottom: 4px;
}

#round-hands-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
}

.hand-entry {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 0;
    white-space: nowrap;
}

.hand-entry .hand-name {
    color: #aaa;
    font-size: 12px;
}

.hand-entry .hand-result {
    font-weight: bold;
    font-size: 13px;
}

.hand-entry .hand-result.hand-waiting {
    color: #888;
}

.hand-entry .hand-result.hand-pinzoro {
    background: linear-gradient(to bottom, #FFF7A8 0%, #FFDF00 40%, #D4AF37 60%, #996515 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hand-entry .hand-result.hand-arashi {
    color: #ff6b6b;
}

.hand-entry .hand-result.hand-shigoro {
    color: #ffa726;
}

.hand-entry .hand-result.hand-hifumi {
    color: #4fc3f7;
}

.hand-entry .hand-result.hand-menashi {
    color: #999;
}

.hand-entry .hand-result.hand-shonben {
    color: #4fc3f7;
    animation: blink 0.5s infinite;
}

.hand-entry .hand-result.hand-normal {
    color: #fff;
}

.hand-entry .hand-result.hand-parent {
    text-decoration: underline;
    text-decoration-color: #ffd700;
}

/* 二択ボタン識別用（JSで使用） */
.destiny-choice-btn {
    /* スタイルは既存のbtn-primary/secondaryを継承 */
}

/* ========== MV SCREEN ========== */
#mv-screen {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #000;
    z-index: 15000;
    cursor: pointer;
}

#mv-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.55) 0%,
        rgba(0, 0, 0, 0.10) 40%,
        rgba(0, 0, 0, 0.10) 70%,
        rgba(0, 0, 0, 0.60) 100%
    );
    z-index: 1;
}

#mv-media-container {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
}

#mv-media-container video,
#mv-media-container img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

#mv-media-container video.mv-active,
#mv-media-container img.mv-active {
    opacity: 1;
}

/* mp4の再生ボタンを非表示 */
#mv-media-container video::-webkit-media-controls {
    display: none !important;
}
#mv-media-container video::-webkit-media-controls-enclosure {
    display: none !important;
}
#mv-media-container video::-webkit-media-controls-panel {
    display: none !important;
}

#mv-skip-text {
    position: absolute;
    bottom: 12%;
    width: 100%;
    text-align: center;
    z-index: 2;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: clamp(1rem, 3.5vw, 1.6rem);
    font-weight: 600;
    color: #FFFFFF;
    text-shadow:
        0 0 8px rgba(0, 0, 0, 0.9),
        0 0 20px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.2em;
    animation: blink 1.5s ease-in-out infinite;
    pointer-events: none;
}


/* ========== START SCREEN 背景スライドショー ========== */
#start-media-container {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
}

#start-media-container img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

#start-media-container img.start-active {
    opacity: 1;
}

/* ========== TERMS SCREEN ========== */
#terms-screen {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 19000;
    justify-content: center;
    align-items: center;
}

.terms-box {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid #ffd700;
    border-radius: 15px;
    padding: 25px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.terms-box h2 {
    color: #ffd700;
    font-size: 24px;
    margin: 0 0 15px 0;
    text-align: center;
    border-bottom: 2px solid rgba(255, 215, 0, 0.4);
    padding-bottom: 10px;
    flex-shrink: 0;
}

.terms-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    font-size: 13px;
    color: #ccc;
    line-height: 1.8;
    margin-bottom: 15px;
}

.terms-content p {
    margin: 0 0 12px 0;
}

.terms-content strong {
    color: #fff;
}

.terms-content::-webkit-scrollbar {
    width: 4px;
}

.terms-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.terms-content::-webkit-scrollbar-thumb {
    background: #ffd700;
    border-radius: 2px;
}

.terms-agree-btn {
    width: 100%;
    padding: 14px;
    font-size: 18px;
    flex-shrink: 0;
}

/* ========== BLACKOUT ANIMATION ========== */
#blackout-container {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 9550;
    background: #000;
}

#blackout-container img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0;
}

#blackout-container img.blackout-active {
    opacity: 1;
}

/* ========== JUDGE SCREEN ========== */
#judge-screen {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 9700;
    background: #000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#judge-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 0;
}

#judge-bg.judge-visible {
    opacity: 1;
}

#judge-bg.judge-vibrate {
    animation: judge-vibrate 0.1s infinite;
}

@keyframes judge-vibrate {
    0%   { transform: translate(2px, 1px); }
    10%  { transform: translate(-1px, -2px); }
    20%  { transform: translate(-3px, 0px); }
    30%  { transform: translate(3px, 2px); }
    40%  { transform: translate(1px, -1px); }
    50%  { transform: translate(-1px, 2px); }
    60%  { transform: translate(-2px, 1px); }
    70%  { transform: translate(3px, 1px); }
    80%  { transform: translate(-1px, -1px); }
    90%  { transform: translate(1px, 2px); }
    100% { transform: translate(1px, -2px); }
}

#judge-buttons {
    display: none;
    position: absolute;
    bottom: 10%;
    left: 0; width: 100%;
    z-index: 2;
    justify-content: center;
    gap: 30px;
    padding: 0 20px;
}

#judge-buttons.judge-buttons-visible {
    display: flex;
}

.judge-btn {
    width: 130px;
    height: 80px;
    font-size: 36px;
    font-weight: 900;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s;
}

.judge-btn:active {
    transform: scale(0.95) translateY(3px);
}

.judge-btn-a {
    background: linear-gradient(135deg, #ff4444, #cc0000);
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.judge-btn-b {
    background: linear-gradient(135deg, #4488ff, #0044cc);
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* ========== SUCCESS SCREEN ========== */
#success-screen {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 9750;
    background: #000;
}

#success-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

#success-bg.success-visible {
    opacity: 1;
}

#success-images {
    position: absolute;
    top: 30%;
    left: 0; width: 100%;
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 1;
    padding: 0 15px;
}

#success-images img {
    width: 28%;
    max-width: 150px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

#success-images img.success-img-visible {
    opacity: 1;
    transform: scale(1);
}

#success-text {
    position: absolute;
    bottom: 25%;
    width: 100%;
    text-align: center;
    z-index: 2;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: clamp(3rem, 14vw, 6rem);
    font-weight: 900;
    letter-spacing: 0.1em;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;

    background: linear-gradient(
        90deg,
        #ff0000, #ff8800, #ffff00, #00ff00,
        #00ffff, #0088ff, #ff00ff, #ff0000
    );
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: rainbow-flow 2s linear infinite;

    text-shadow: none;
    filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.8));
}


#success-text.success-text-visible {
    opacity: 1;
}

@keyframes rainbow-flow {
    0%   { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

/* ========== LOSE SCREEN ========== */
#lose-screen {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 9750;
    background: #000;
    cursor: pointer;
}

#lose-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

#lose-bg.lose-visible {
    opacity: 1;
}

#lose-skip-text {
    position: absolute;
    bottom: 10%;
    width: 100%;
    text-align: center;
    z-index: 1;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: clamp(0.9rem, 3vw, 1.4rem);
    color: rgba(255, 255, 255, 0.7);
    animation: blink 1.5s ease-in-out infinite;
    pointer-events: none;
}

/* ========== JUDGE ラベル ========== */

#judge-label {
    position: absolute;
    top: 8%;
    left: 5%;
    z-index: 2;
    font-size: clamp(1.2rem, 5vw, 2rem);
    font-weight: 900;
    letter-spacing: 0.1em;
    pointer-events: none;
    text-align: left;
}

.judge-label-base {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    color: #fff;
    text-shadow:
        -1px -1px 0 #000, 1px -1px 0 #000,
        -1px  1px 0 #000, 1px  1px 0 #000;
    line-height: 1.6;
}

.judge-label-pinzoro {
    display: inline-block;
    background: linear-gradient(
        90deg,
        #ff0000, #ff8800, #ffff00, #00ff00,
        #00ffff, #0088ff, #ff00ff, #ff0000
    );
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    text-shadow: none;
    animation: rainbow-flow 2s linear infinite;
    filter: drop-shadow(2px 2px 0 #000) drop-shadow(-2px -2px 0 #000);

//* ローディング画面 */
#loading-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(ellipse at 40% 50%, #2a2a5e 0%, #1a1a3e 40%, #0d0d2b 100%);
    z-index: 9000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#loading-screen::before,
#loading-screen::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 80px;
    background: linear-gradient(to bottom, transparent, rgba(180, 180, 255, 0.6), transparent);
    transform: rotate(-35deg);
    animation: shooting-star 3s linear infinite;
    opacity: 0;
}

#loading-screen::before {
    top: 15%; right: 20%;
    animation-delay: 0s;
}

#loading-screen::after {
    top: 40%; right: 35%;
    animation-delay: 1.5s;
}

@keyframes shooting-star {
    0% { opacity: 0; transform: rotate(-35deg) translateY(-100px); }
    10% { opacity: 1; }
    30% { opacity: 0; transform: rotate(-35deg) translateY(300px); }
    100% { opacity: 0; }
}

#loading-logo {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: clamp(2rem, 8vw, 3.5rem);
    font-weight: 900;
    letter-spacing: 0.05em;
    background: linear-gradient(180deg, #c0c0d0 0%, #8888aa 50%, #606080 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
    margin-bottom: 10px;
    z-index: 1;
}

#loading-icon {
    font-size: clamp(2rem, 6vw, 3rem);
    margin-bottom: 40px;
    z-index: 1;
    opacity: 0.6;
    filter: drop-shadow(0 2px 6px rgba(100, 100, 180, 0.5));
}

#loading-bar-container {
    position: relative;
    z-index: 1;
    margin-top: 10vh;
    width: 65%;
    max-width: 350px;
    height: 14px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    box-shadow: 0 0 15px rgba(100, 100, 200, 0.2);
}

#loading-bar {
    width: 0%;
    height: 100%;
    border-radius: 9px;
    background: linear-gradient(90deg, #6666aa, #8888cc, #aaaaee, #8888cc, #6666aa);
    background-size: 300% 100%;
    animation: loading-gradient 1.5s linear infinite;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(130, 130, 220, 0.5);
}

@keyframes loading-gradient {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

#loading-text {
    position: relative;
    z-index: 1;
    margin-top: 12px;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: clamp(0.8rem, 2.5vw, 1.1rem);
    font-weight: 600;
    color: rgba(200, 200, 230, 0.7);
    letter-spacing: 0.2em;
    animation: blink 1.5s ease-in-out infinite;
}
