/* メインゲーム画面 */
.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.deck-info, .turn-info {
    font-size: 1.1em;
    font-weight: bold;
}

.center-status-stack {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 8px;
    min-width: 150px;
    align-items: stretch;
}

.center-status-pill {
    padding: 9px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.9);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    white-space: nowrap;
}

.turn-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: center;
}

.turn-number {
    grid-column: 2;
    grid-row: 1 / span 2;
    min-width: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1f2937;
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.turn-timer {
    font-size: 0.82em;
    font-weight: 700;
    color: #2f3640;
}

.turn-timer.warning {
    color: #d35400;
}

.turn-timer.danger {
    color: #c0392b;
}

.turn-timer.hidden {
    display: none;
}

.opponent-area, .player-area {
    background: rgba(255,255,255,0.9);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* プレイヤーエリアのマージンを調整 */
.player-area {
    margin-bottom: 10px;
}

.hand-area-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 15px;
}

.opponent-area h3, .player-area h3 {
    margin: 0;
    color: #444;
    font-size: 1.2em;
}

.turn-effect-badges {
    min-height: 28px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.turn-effect-badges:empty {
    display: none;
}

.turn-effect-badge {
    position: relative;
    overflow: visible;
    min-height: 28px;
    padding: 4px 9px;
    border: 1px solid rgba(70, 132, 190, 0.62);
    border-radius: 999px;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.72), transparent 30%),
        linear-gradient(135deg, rgba(219, 238, 255, 0.94), rgba(125, 185, 230, 0.88));
    color: #12324f;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        0 2px 5px rgba(31, 78, 121, 0.18);
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
    font-family: inherit;
    cursor: pointer;
    pointer-events: auto;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.turn-effect-badge:hover,
.turn-effect-badge:focus-visible {
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.62),
        0 4px 10px rgba(31, 78, 121, 0.24);
}

.turn-effect-badge:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 2px;
}

.turn-effect-badge-block {
    border-color: rgba(196, 73, 73, 0.68);
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.72), transparent 30%),
        linear-gradient(135deg, rgba(255, 224, 224, 0.95), rgba(226, 121, 121, 0.88));
    color: #5c1717;
}

.turn-effect-badge-shield {
    border-color: rgba(62, 145, 93, 0.68);
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.72), transparent 30%),
        linear-gradient(135deg, rgba(223, 250, 232, 0.95), rgba(113, 196, 145, 0.88));
    color: #123f25;
}

.turn-effect-badge-inscription {
    border-color: rgba(54, 128, 198, 0.68);
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.72), transparent 30%),
        linear-gradient(135deg, rgba(218, 240, 255, 0.96), rgba(93, 169, 225, 0.9));
    color: #0d355c;
}

.turn-effect-badge.is-newly-applied {
    z-index: 3;
    animation: turn-effect-badge-apply 920ms cubic-bezier(0.18, 0.86, 0.28, 1);
}

.turn-effect-badge.is-newly-applied::before {
    content: "";
    position: absolute;
    inset: -6px;
    border: 2px solid rgba(255, 255, 255, 0.86);
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
    animation: turn-effect-badge-ring 920ms cubic-bezier(0.18, 0.86, 0.28, 1);
}

.turn-effect-badge.is-newly-applied::after {
    content: "";
    position: absolute;
    inset: 2px;
    border-radius: inherit;
    background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.82) 42%, transparent 74%);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-115%);
    animation: turn-effect-badge-sheen 760ms ease-out 70ms;
}

.turn-effect-badge-grant-label {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(18, 32, 47, 0.9);
    color: #ffffff;
    box-shadow: 0 5px 12px rgba(15, 23, 42, 0.28);
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1.25;
    pointer-events: none;
    transform: translate(-50%, 6px) scale(0.82);
    opacity: 0;
    animation: turn-effect-badge-label 920ms cubic-bezier(0.18, 0.86, 0.28, 1);
}

@keyframes turn-effect-badge-apply {
    0% {
        transform: translateY(4px) scale(0.84);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.7),
            0 0 0 rgba(31, 78, 121, 0);
    }
    42% {
        transform: translateY(-3px) scale(1.08);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.8),
            0 10px 22px rgba(31, 78, 121, 0.34);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

@keyframes turn-effect-badge-ring {
    0% {
        opacity: 0.85;
        transform: scale(0.76);
    }
    100% {
        opacity: 0;
        transform: scale(1.34);
    }
}

@keyframes turn-effect-badge-sheen {
    0% {
        opacity: 0;
        transform: translateX(-115%);
    }
    22% {
        opacity: 0.9;
    }
    100% {
        opacity: 0;
        transform: translateX(115%);
    }
}

@keyframes turn-effect-badge-label {
    0% {
        opacity: 0;
        transform: translate(-50%, 7px) scale(0.82);
    }
    24%,
    66% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -5px) scale(0.94);
    }
}

@media (prefers-reduced-motion: reduce) {
    .turn-effect-badge.is-newly-applied,
    .turn-effect-badge.is-newly-applied::before,
    .turn-effect-badge.is-newly-applied::after,
    .turn-effect-badge-grant-label {
        animation: none;
    }

    .turn-effect-badge-grant-label {
        display: none;
    }
}

/* プレイスフィールド */
.opponent-place-area, .player-place-area {
    margin: 20px 0;
}

/* プレイヤープレイスフィールドのマージンを調整 */
.player-place-area {
    margin: 10px 0;
}

.place-field {
    --place-rule-gauge-width: 138px;
    --place-score-panel-width: 96px;
    background: rgba(255,255,255,0.9);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: grid;
    grid-template-columns: var(--place-rule-gauge-width) minmax(0, 1fr) var(--place-score-panel-width);
    gap: 8px;
    align-items: center;
}

.opponent-place {
    grid-template-columns: var(--place-score-panel-width) minmax(0, 1fr) var(--place-rule-gauge-width);
}

/* プレイヤープレイスフィールドのパディングを調整 */
.player-place-area .place-field {
    padding: 15px;
}

.place-field h3 {
    grid-column: 1 / -1;
    margin-bottom: 15px;
    color: #444;
    font-size: 1.1em;
    text-align: center;
}

.place-field-cards {
    display: flex;
    gap: 10px;
    min-height: 130px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}

.player-place .place-field-cards {
    grid-column: 2;
}

.opponent-place .place-field-cards {
    grid-column: 2;
}

.place-score-panel {
    position: relative;
    width: var(--place-score-panel-width);
    min-height: 78px;
    padding: 8px 7px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 10px;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.28), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(220, 236, 224, 0.16));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.30),
        0 4px 10px rgba(18, 48, 24, 0.10);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #123f25;
    text-align: center;
    backdrop-filter: blur(2px) saturate(1.04);
    overflow: visible;
}

.player-place .place-score-panel {
    grid-column: 3;
    justify-self: end;
}

.opponent-place .place-score-panel {
    grid-column: 1;
    justify-self: start;
}

.place-score-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.1;
    opacity: 0.82;
}

.place-score-value {
    min-width: 52px;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(11, 52, 29, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: #0d321d;
    font-size: 1.95rem;
    font-weight: 900;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.34);
    transition:
        transform 180ms ease,
        filter 180ms ease,
        opacity 180ms ease;
}

.place-score-panel.is-hidden-score .place-score-value {
    color: #17324a;
    letter-spacing: 0.03em;
}

.place-score-value.is-score-pending {
    transform: scale(0.96);
    filter: saturate(0.95);
    opacity: 0.86;
}

.place-score-panel.score-value-committed .place-score-value {
    animation: place-score-value-pop 320ms cubic-bezier(0.17, 0.84, 0.44, 1) both;
}

.place-score-delta {
    position: absolute;
    left: 50%;
    top: -22px;
    z-index: 6;
    min-width: 42px;
    padding: 2px 9px 3px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.58);
    background:
        radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.88), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(233, 240, 232, 0.82));
    box-shadow:
        0 5px 12px rgba(15, 35, 22, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.68);
    color: #183322;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.1;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.92);
    font-variant-numeric: tabular-nums;
}

.place-score-delta.is-positive {
    color: #087a37;
    border-color: rgba(80, 210, 128, 0.62);
    background:
        radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.90), transparent 34%),
        linear-gradient(180deg, rgba(233, 255, 238, 0.96), rgba(135, 222, 159, 0.82));
}

.place-score-delta.is-negative {
    color: #ad2424;
    border-color: rgba(232, 109, 109, 0.66);
    background:
        radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.90), transparent 34%),
        linear-gradient(180deg, rgba(255, 237, 237, 0.96), rgba(237, 143, 143, 0.82));
}

.place-score-delta.is-playing {
    animation: place-score-delta-float 720ms cubic-bezier(0.16, 0.86, 0.42, 1) both;
}

@keyframes place-score-delta-float {
    0% {
        opacity: 0;
        transform: translate(-50%, 10px) scale(0.88);
    }
    18% {
        opacity: 1;
        transform: translate(-50%, -2px) scale(1.10);
    }
    68% {
        opacity: 1;
        transform: translate(-50%, -10px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -18px) scale(0.96);
    }
}

@keyframes place-score-value-pop {
    0% {
        transform: scale(0.94);
        filter: brightness(1);
    }
    58% {
        transform: scale(1.12);
        filter: brightness(1.16);
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .place-score-delta.is-playing,
    .place-score-panel.score-value-committed .place-score-value {
        animation-duration: 1ms;
    }
}

.place-rule-gauge {
    width: var(--place-rule-gauge-width);
    min-height: 94px;
    padding: 8px;
    border: 1px solid rgba(44, 62, 80, 0.22);
    border-radius: 10px;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.70), transparent 38%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(226, 232, 240, 0.52));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.68),
        0 4px 10px rgba(31, 41, 55, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    pointer-events: auto;
}

.player-place .place-rule-gauge {
    grid-column: 1;
    justify-self: start;
}

.opponent-place .place-rule-gauge {
    grid-column: 3;
    justify-self: end;
}

.place-rule-blue-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.place-rule-small-grid {
    display: grid;
    grid-template-columns: repeat(4, 14px);
    grid-template-rows: repeat(2, 14px);
    gap: 5px 4px;
}

.place-rule-blue-large-row,
.place-rule-orange-column {
    display: flex;
    gap: 5px;
}

.place-rule-orange-column {
    flex-direction: row;
    align-self: center;
    margin-bottom: 0;
}

.place-rule-dot {
    display: block;
    position: relative;
    border-radius: 999px;
    background:
        radial-gradient(circle at 35% 28%, rgba(125, 185, 230, 0.18), transparent 38%),
        linear-gradient(180deg, #294d73, #18334f);
    border: 1px solid rgba(137, 176, 210, 0.28);
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.10),
        inset 0 -1px 2px rgba(0, 12, 28, 0.24),
        0 1px 2px rgba(15, 23, 42, 0.12);
}

.place-rule-dot-small {
    width: 14px;
    height: 14px;
}

.place-rule-dot-large {
    width: 22px;
    height: 22px;
}

.place-rule-dot-orange {
    background:
        radial-gradient(circle at 35% 28%, rgba(255, 178, 93, 0.16), transparent 40%),
        linear-gradient(180deg, #7a4a25, #4a2d19);
    border-color: rgba(214, 147, 82, 0.30);
    cursor: pointer;
}

.place-rule-blue-group .place-rule-dot {
    cursor: pointer;
}

.place-rule-dot:focus-visible {
    outline: 2px solid rgba(255, 215, 154, 0.95);
    outline-offset: 3px;
}

.place-rule-dot-orange.is-locked {
    background:
        radial-gradient(circle at 35% 28%, rgba(255, 210, 160, 0.10), transparent 40%),
        linear-gradient(180deg, #4a3525, #241910);
    border-color: rgba(138, 97, 58, 0.34);
}

.place-rule-dot.is-locked {
    overflow: visible;
    isolation: isolate;
}

.place-rule-dot.is-locked::before {
    content: "";
    position: absolute;
    inset: -3px;
    z-index: 1;
    border-radius: 999px;
    pointer-events: none;
    background:
        linear-gradient(45deg,
            transparent 34%,
            rgba(7, 10, 16, 0.88) 34%,
            rgba(7, 10, 16, 0.88) 39%,
            rgba(210, 219, 229, 0.82) 39%,
            rgba(210, 219, 229, 0.82) 44%,
            rgba(7, 10, 16, 0.88) 44%,
            rgba(7, 10, 16, 0.88) 49%,
            transparent 49%),
        linear-gradient(-45deg,
            transparent 34%,
            rgba(7, 10, 16, 0.88) 34%,
            rgba(7, 10, 16, 0.88) 39%,
            rgba(210, 219, 229, 0.82) 39%,
            rgba(210, 219, 229, 0.82) 44%,
            rgba(7, 10, 16, 0.88) 44%,
            rgba(7, 10, 16, 0.88) 49%,
            transparent 49%);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.65));
}

.place-rule-dot.is-locked::after {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    min-width: 13px;
    height: 13px;
    padding: 0 2px;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(2, 8, 23, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.22);
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 0 5px rgba(0, 0, 0, 0.42);
}

.place-rule-dot-small.is-locked::after {
    min-width: 12px;
    height: 12px;
    padding: 0 1px;
    font-size: 0.56rem;
}

.place-rule-dot-large.is-locked::after,
.place-rule-dot-orange.is-locked::after {
    min-width: 15px;
    height: 15px;
    font-size: 0.66rem;
}

.place-rule-dot-orange.is-locked::after {
    content: attr(data-fusion-label);
    color: #ffd39b;
    border-color: rgba(255, 211, 155, 0.32);
}

.place-rule-dot.is-locked:not(.place-rule-dot-orange) {
    background:
        radial-gradient(circle at 35% 28%, rgba(125, 211, 252, 0.10), transparent 38%),
        linear-gradient(180deg, #1c3958, #102337);
    border-color: rgba(94, 165, 209, 0.28);
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.08),
        inset 0 -1px 2px rgba(0, 12, 28, 0.34),
        0 0 0 rgba(14, 165, 233, 0);
}

.place-rule-dot.is-locked:not(.place-rule-dot-orange)::after {
    content: attr(data-inscription-label);
    color: #a7e3ff;
    border-color: rgba(167, 227, 255, 0.30);
}

.place-rule-dot-orange.is-spent {
    opacity: 0.20;
    transform: scale(0.78);
}

.place-rule-dot.is-spent:not(.place-rule-dot-orange) {
    opacity: 0.28;
    transform: scale(0.82);
}

.place-rule-dot.is-disabled-by-rule {
    background:
        radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.14), transparent 34%),
        linear-gradient(180deg, rgba(71, 85, 105, 0.40), rgba(15, 23, 42, 0.56));
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow: none;
    filter: grayscale(0.8) brightness(0.72);
}

.place-rule-dot.is-active {
    background:
        radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.72), transparent 30%),
        linear-gradient(180deg, #55d7ff, #0b7fdb);
    border-color: rgba(181, 240, 255, 0.92);
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.40),
        0 0 9px rgba(14, 165, 233, 0.62);
}

.place-rule-dot-orange.is-active {
    background:
        radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.76), transparent 30%),
        linear-gradient(180deg, #ffbd5b, #f26a1b);
    border-color: rgba(255, 215, 154, 0.96);
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.48),
        0 0 10px rgba(242, 106, 27, 0.66);
}

.place-field-cards::before {
    content: "プレイスフィールド";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5em;
    font-weight: bold;
    color: rgba(0, 0, 0, 0.1);
    pointer-events: none;
    z-index: 0;
    white-space: nowrap;
}

/* プレイヤープレイスフィールドの最小高さを調整 */
.player-place-area .place-field-cards {
    min-height: 100px;
}

.place-stack {
    --place-stack-card-width: 86px;
    --place-stack-card-height: 129px;
    --place-stack-height: var(--place-stack-card-height);
    position: relative;
    width: var(--place-stack-card-width);
    min-width: var(--place-stack-card-width);
    height: var(--place-stack-height);
    margin: 0 18px;
}

.place-stack .card {
    position: absolute;
    top: 0;
    left: 0;
    z-index: var(--place-card-z, 1);
    transition: transform 0.3s ease, box-shadow 0.2s ease;
    transform: translateY(var(--place-card-offset-y, 0px));
}

.hand {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    min-height: 130px;
    align-items: center;
}

.card {
    width: 80px;
    height: 120px;
    border: 2px solid #333;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.place-stack .card:hover {
    transform: translateY(var(--place-card-offset-y, 0px));
}

.card.back {
    background: linear-gradient(45deg, #2c3e50, #34495e);
    color: white;
    cursor: default;
}

.card.selected {
    transform: translateY(-10px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
    border-color: #3498db;
}

.card.place-selected {
    transform: translateY(-10px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
    border-color: #27ae60;
    border-width: 3px;
    background: white;
    color: #333;
}

.center-area {
    display: flex;
    justify-content: center;
    margin: 14px 0;
}

.deck-area {
    display: flex;
    align-items: center;
    justify-content: center;
}

.deck-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.deck-graveyard-container {
    display: flex;
    align-items: center;
    gap: 18px;
}

.graveyard {
    background: rgba(255,255,255,0.9);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    min-width: 120px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.graveyard h3 {
    margin: 0 0 10px 0;
    color: #444;
    font-size: 1.1em;
    text-align: center;
}

.graveyard-cards {
    --graveyard-card-visible-step: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80px;
    position: relative;
    padding: 0 40px;
}

.graveyard-cards::before {
    content: "墓地";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2em;
    font-weight: bold;
    color: rgba(0, 0, 0, 0.1);
    pointer-events: none;
    z-index: 0;
    white-space: nowrap;
}

.graveyard-card {
    width: 80px;
    height: 120px;
    border: 2px solid #333;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    position: relative;
    flex: 0 0 auto;
    z-index: 1;
    transition: transform 0.2s ease;
    cursor: pointer;
    left: auto;
    transform: none;
}

.graveyard-card + .graveyard-card {
    margin-left: calc(var(--graveyard-card-visible-step) - var(--cg-card-width, 72px));
}

.graveyard-card:hover {
    transform: translateY(-2px);
    z-index: 20;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    border: 2px solid #27ae60;
    background-color: #e8f5e8;
}

.graveyard-card.selected {
    border: 2px solid #27ae60;
    background-color: #e8f5e8;
    z-index: 20;
}

.graveyard-card.selected,
.graveyard-card.selected:hover {
    transform: none;
    z-index: 30;
}

.deck {
    width: 60px;
    height: 80px;
    background: linear-gradient(45deg, #2c3e50, #34495e);
    border: 2px solid #1a252f;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.deck:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.turn-status-text {
    font-size: 1.5em;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 10px;
    background: rgba(255,255,255,0.9);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.turn-status-text.player-turn {
    color: #27ae60;
    border: 3px solid #27ae60;
    animation: playerTurnGlow 2s ease-in-out infinite alternate;
}

.turn-status-text.opponent-turn {
    color: #e74c3c;
    border: 3px solid #e74c3c;
    animation: opponentTurnGlow 2s ease-in-out infinite alternate;
}

@keyframes playerTurnGlow {
    from { 
        box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
        text-shadow: 0 0 5px rgba(39, 174, 96, 0.5);
    }
    to { 
        box-shadow: 0 4px 20px rgba(39, 174, 96, 0.6);
        text-shadow: 0 0 15px rgba(39, 174, 96, 0.8);
    }
}

@keyframes opponentTurnGlow {
    from { 
        box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
        text-shadow: 0 0 5px rgba(231, 76, 60, 0.5);
    }
    to { 
        box-shadow: 0 4px 20px rgba(231, 76, 60, 0.6);
        text-shadow: 0 0 15px rgba(231, 76, 60, 0.8);
    }
}

/* エフェクト付きメッセージ */
.turn-message-effect {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3em;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    z-index: 2000;
    pointer-events: none;
    animation: turnMessageEffect 1s ease-out forwards;
}

@keyframes turnMessageEffect {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1);
    }
}

.inscription-unlock-effect {
    position: fixed;
    inset: 0;
    z-index: 2300;
    display: grid;
    place-items: center;
    pointer-events: none;
    color: #e6f7ff;
    text-align: center;
    animation: inscriptionUnlockFade 1.4s ease forwards;
}

.inscription-unlock-effect::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 50%, rgba(14, 165, 233, 0.22), transparent 26%),
        radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.12), transparent 45%),
        rgba(2, 8, 23, 0.22);
    animation: inscriptionUnlockFlash 1.4s ease forwards;
}

.inscription-unlock-ring {
    position: absolute;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    border: 1px solid rgba(186, 230, 253, 0.55);
    box-shadow:
        0 0 22px rgba(56, 189, 248, 0.34),
        inset 0 0 26px rgba(14, 165, 233, 0.20);
    animation: inscriptionUnlockRing 1.4s ease forwards;
}

.inscription-unlock-ring::before,
.inscription-unlock-ring::after {
    content: "";
    position: absolute;
    inset: 24px;
    border-radius: 50%;
    border: 1px dashed rgba(125, 211, 252, 0.64);
}

.inscription-unlock-ring::after {
    inset: 52px;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.28);
}

.inscription-unlock-dot {
    --dot-angle: calc(var(--dot-index) * 45deg);
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.9), transparent 32%),
        linear-gradient(180deg, #67e8f9, #0284c7);
    border: 1px solid rgba(224, 242, 254, 0.9);
    box-shadow: 0 0 14px rgba(14, 165, 233, 0.9);
    transform:
        translate(-50%, -50%)
        rotate(var(--dot-angle))
        translateY(-125px)
        rotate(calc(var(--dot-angle) * -1));
    animation: inscriptionUnlockDot 1.4s ease forwards;
    animation-delay: calc(var(--dot-index) * 0.035s);
}

.inscription-unlock-title {
    position: relative;
    z-index: 1;
    margin-top: -10px;
    font-size: clamp(2.3rem, 5vw, 4.4rem);
    font-weight: 900;
    letter-spacing: 0.08em;
    text-shadow:
        0 0 10px rgba(14, 165, 233, 0.96),
        0 0 26px rgba(59, 130, 246, 0.72),
        0 2px 6px rgba(2, 8, 23, 0.72);
    animation: inscriptionUnlockTitle 1.4s ease forwards;
}

.inscription-unlock-subtitle {
    position: relative;
    z-index: 1;
    margin-top: 86px;
    padding: 7px 14px;
    border: 1px solid rgba(186, 230, 253, 0.42);
    border-radius: 999px;
    background: rgba(8, 47, 73, 0.42);
    box-shadow: 0 0 14px rgba(14, 165, 233, 0.20);
    color: #dff6ff;
    font-size: 1rem;
    font-weight: 800;
    text-shadow: 0 1px 3px rgba(2, 8, 23, 0.8);
    animation: inscriptionUnlockSubtitle 1.4s ease forwards;
}

@keyframes inscriptionUnlockFade {
    0% { opacity: 0; }
    10% { opacity: 1; }
    82% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes inscriptionUnlockFlash {
    0% { opacity: 0; }
    18% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes inscriptionUnlockRing {
    0% {
        opacity: 0;
        transform: scale(0.42) rotate(-22deg);
        filter: blur(2px);
    }
    24% {
        opacity: 1;
        transform: scale(1.08) rotate(4deg);
        filter: blur(0);
    }
    68% {
        opacity: 1;
        transform: scale(1) rotate(18deg);
    }
    100% {
        opacity: 0;
        transform: scale(1.22) rotate(36deg);
    }
}

@keyframes inscriptionUnlockDot {
    0% { opacity: 0; filter: brightness(0.4); }
    20% { opacity: 1; filter: brightness(1.4); }
    72% { opacity: 1; }
    100% { opacity: 0; filter: brightness(0.9); }
}

@keyframes inscriptionUnlockTitle {
    0% {
        opacity: 0;
        transform: translateY(18px) scale(0.84);
    }
    20% {
        opacity: 1;
        transform: translateY(0) scale(1.08);
    }
    56% {
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-10px) scale(1);
    }
}

@keyframes inscriptionUnlockSubtitle {
    0%, 18% {
        opacity: 0;
        transform: translateY(10px);
    }
    34%, 78% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-6px);
    }
}

.aura-unlock-effect {
    position: fixed;
    inset: 0;
    z-index: 2320;
    display: grid;
    place-items: center;
    pointer-events: none;
    color: #effaff;
    text-align: center;
    overflow: hidden;
    animation: auraUnlockFade 1.55s ease forwards;
}

.aura-unlock-effect::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 52%, rgba(255, 255, 255, 0.22), transparent 12%),
        radial-gradient(circle at 50% 52%, rgba(56, 189, 248, 0.36), transparent 28%),
        radial-gradient(circle at 50% 52%, rgba(129, 140, 248, 0.20), transparent 48%),
        rgba(2, 6, 23, 0.34);
    animation: auraUnlockVignette 1.55s ease forwards;
}

.aura-unlock-effect::after {
    content: "";
    position: absolute;
    left: -10vw;
    top: 48%;
    width: 120vw;
    height: 3px;
    background:
        linear-gradient(90deg, transparent, rgba(125, 211, 252, 0.92), #ffffff, rgba(99, 102, 241, 0.84), transparent);
    box-shadow:
        0 0 22px rgba(125, 211, 252, 0.92),
        0 0 46px rgba(99, 102, 241, 0.54);
    transform: rotate(-8deg) translateX(-34vw);
    animation: auraUnlockSweep 1.05s cubic-bezier(0.18, 0.9, 0.28, 1) 0.2s forwards;
    opacity: 0;
}

.aura-unlock-burst {
    position: absolute;
    width: min(520px, 82vw);
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        conic-gradient(
            from 20deg,
            transparent 0deg,
            rgba(125, 211, 252, 0.22) 12deg,
            transparent 26deg,
            rgba(167, 139, 250, 0.18) 42deg,
            transparent 62deg
        );
    filter: blur(1px);
    animation: auraUnlockBurst 1.55s ease forwards;
}

.aura-unlock-ring {
    position: absolute;
    width: min(330px, 62vw);
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px solid rgba(186, 230, 253, 0.76);
    box-shadow:
        0 0 22px rgba(56, 189, 248, 0.72),
        0 0 60px rgba(99, 102, 241, 0.34),
        inset 0 0 28px rgba(224, 242, 254, 0.24);
    animation: auraUnlockRing 1.55s cubic-bezier(0.18, 0.88, 0.28, 1) forwards;
}

.aura-unlock-ring::before,
.aura-unlock-ring::after {
    content: "";
    position: absolute;
    inset: 24px;
    border-radius: 50%;
    border: 1px dashed rgba(216, 180, 254, 0.72);
    animation: auraUnlockInnerRing 1.55s ease forwards;
}

.aura-unlock-ring::after {
    inset: 56px;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.34);
    animation-direction: reverse;
}

.aura-unlock-shard {
    --shard-angle: calc(var(--shard-index) * 30deg);
    position: absolute;
    left: 50%;
    top: 50%;
    width: 7px;
    height: 24px;
    border-radius: 999px;
    background:
        linear-gradient(180deg, #ffffff, #7dd3fc 48%, rgba(129, 140, 248, 0.24));
    box-shadow: 0 0 14px rgba(125, 211, 252, 0.92);
    transform:
        translate(-50%, -50%)
        rotate(var(--shard-angle))
        translateY(-164px);
    opacity: 0;
    animation: auraUnlockShard 1.08s ease forwards;
    animation-delay: calc(0.18s + var(--shard-index) * 0.018s);
}

.aura-unlock-chains {
    position: absolute;
    width: min(410px, 78vw);
    height: 130px;
    display: grid;
    place-items: center;
    animation: auraUnlockChains 1.55s ease forwards;
}

.aura-unlock-chains span {
    position: absolute;
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background:
        repeating-linear-gradient(
            90deg,
            rgba(51, 65, 85, 0.92) 0 14px,
            rgba(148, 163, 184, 0.92) 14px 26px,
            rgba(226, 232, 240, 0.92) 26px 34px
        );
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.18),
        0 7px 18px rgba(2, 6, 23, 0.42);
}

.aura-unlock-chains span:first-child {
    transform: rotate(13deg);
    animation: auraUnlockChainBreakA 1.55s cubic-bezier(0.18, 0.88, 0.28, 1) forwards;
}

.aura-unlock-chains span:last-child {
    transform: rotate(-13deg);
    animation: auraUnlockChainBreakB 1.55s cubic-bezier(0.18, 0.88, 0.28, 1) forwards;
}

.aura-unlock-title {
    position: relative;
    z-index: 2;
    margin-top: -44px;
    color: #ffffff;
    font-size: clamp(2.6rem, 7vw, 5.4rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.04em;
    text-shadow:
        0 0 10px rgba(255, 255, 255, 0.95),
        0 0 26px rgba(56, 189, 248, 0.95),
        0 0 54px rgba(129, 140, 248, 0.74),
        0 4px 12px rgba(2, 6, 23, 0.82);
    animation: auraUnlockTitle 1.55s cubic-bezier(0.18, 0.88, 0.28, 1) forwards;
}

.aura-unlock-slots {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 10px;
    margin-top: 118px;
    transform: translateY(0);
}

.aura-unlock-slot {
    min-width: 82px;
    padding: 8px 12px;
    border: 1px solid rgba(186, 230, 253, 0.72);
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(236, 253, 255, 0.92), rgba(147, 197, 253, 0.62));
    color: #0f172a;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.32),
        0 0 20px rgba(56, 189, 248, 0.42);
    font-size: 0.82rem;
    font-weight: 900;
    opacity: 0;
    transform: translateY(18px) scale(0.72);
    animation: auraUnlockSlot 1.1s cubic-bezier(0.18, 0.9, 0.28, 1) forwards;
    animation-delay: calc(0.48s + var(--slot-index) * 0.08s);
}

.aura-unlock-slot:last-child {
    color: #075985;
    background:
        linear-gradient(180deg, rgba(240, 249, 255, 0.98), rgba(125, 211, 252, 0.78));
    border-color: rgba(255, 255, 255, 0.86);
}

.aura-unlock-subtitle {
    position: relative;
    z-index: 2;
    margin-top: 214px;
    padding: 8px 16px;
    border: 1px solid rgba(191, 219, 254, 0.48);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.48);
    color: #e0f2fe;
    box-shadow:
        0 0 18px rgba(56, 189, 248, 0.24),
        inset 0 0 14px rgba(255, 255, 255, 0.08);
    font-size: 1rem;
    font-weight: 900;
    text-shadow: 0 1px 4px rgba(2, 6, 23, 0.82);
    animation: auraUnlockSubtitle 1.55s ease forwards;
}

body.aura-unlock-player .player-area,
body.aura-unlock-opponent .opponent-area {
    animation: auraUnlockAreaPulse 1.45s ease-out;
}

@keyframes auraUnlockFade {
    0% { opacity: 0; }
    8% { opacity: 1; }
    82% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes auraUnlockVignette {
    0% { opacity: 0; transform: scale(1.08); }
    20% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.05); }
}

@keyframes auraUnlockSweep {
    0% { opacity: 0; transform: rotate(-8deg) translateX(-34vw); }
    18% { opacity: 1; }
    78% { opacity: 1; }
    100% { opacity: 0; transform: rotate(-8deg) translateX(34vw); }
}

@keyframes auraUnlockBurst {
    0% { opacity: 0; transform: scale(0.44) rotate(-40deg); filter: blur(8px); }
    22% { opacity: 1; transform: scale(1.04) rotate(14deg); filter: blur(1px); }
    74% { opacity: 0.86; transform: scale(1.14) rotate(92deg); }
    100% { opacity: 0; transform: scale(1.34) rotate(160deg); }
}

@keyframes auraUnlockRing {
    0% { opacity: 0; transform: scale(0.32) rotate(-32deg); }
    24% { opacity: 1; transform: scale(1.1) rotate(6deg); }
    58% { opacity: 1; transform: scale(0.98) rotate(32deg); }
    100% { opacity: 0; transform: scale(1.26) rotate(72deg); }
}

@keyframes auraUnlockInnerRing {
    0% { transform: rotate(0deg); opacity: 0; }
    24% { opacity: 1; }
    100% { transform: rotate(180deg); opacity: 0; }
}

@keyframes auraUnlockShard {
    0% {
        opacity: 0;
        filter: brightness(0.6);
    }
    22% {
        opacity: 1;
        filter: brightness(1.5);
    }
    100% {
        opacity: 0;
        transform:
            translate(-50%, -50%)
            rotate(var(--shard-angle))
            translateY(-224px)
            scale(0.38);
    }
}

@keyframes auraUnlockChains {
    0%, 28% { opacity: 1; }
    72% { opacity: 0.92; }
    100% { opacity: 0; }
}

@keyframes auraUnlockChainBreakA {
    0%, 26% { transform: rotate(13deg) translate(0, 0); opacity: 1; }
    44% { transform: rotate(13deg) translate(0, 0) scaleX(1.02); filter: brightness(1.7); }
    100% { transform: rotate(28deg) translate(-190px, -74px) scaleX(0.34); opacity: 0; }
}

@keyframes auraUnlockChainBreakB {
    0%, 26% { transform: rotate(-13deg) translate(0, 0); opacity: 1; }
    44% { transform: rotate(-13deg) translate(0, 0) scaleX(1.02); filter: brightness(1.7); }
    100% { transform: rotate(-28deg) translate(190px, 74px) scaleX(0.34); opacity: 0; }
}

@keyframes auraUnlockTitle {
    0% { opacity: 0; transform: translateY(22px) scale(0.78); filter: blur(5px); }
    20% { opacity: 1; transform: translateY(0) scale(1.16); filter: blur(0); }
    38% { transform: translateY(0) scale(1); }
    78% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-12px) scale(1); }
}

@keyframes auraUnlockSlot {
    0% { opacity: 0; transform: translateY(18px) scale(0.72); filter: brightness(0.6); }
    34% { opacity: 1; transform: translateY(0) scale(1.08); filter: brightness(1.36); }
    56% { transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-8px) scale(1); }
}

@keyframes auraUnlockSubtitle {
    0%, 28% { opacity: 0; transform: translateY(10px); }
    42%, 78% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-8px); }
}

@keyframes auraUnlockAreaPulse {
    0% { filter: brightness(1); }
    18% { filter: brightness(1.42) drop-shadow(0 0 26px rgba(56, 189, 248, 0.52)); }
    74% { filter: brightness(1.16) drop-shadow(0 0 16px rgba(129, 140, 248, 0.28)); }
    100% { filter: brightness(1); }
}

.hidden {
    display: none;
}

.player-actions {
    display: flex;
    gap: 10px;
    margin-top: 0;
    justify-content: center;
}

.player-control-row {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.action-btn {
    padding: 10px 20px;
    font-size: 1.1em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.action-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}



/* エフェクト */
#effects-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #f39c12;
    border-radius: 50%;
    animation: sparkle 1s linear forwards;
}

@keyframes sparkle {
    0% {
        opacity: 1;
        transform: scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1) rotate(180deg);
    }
    100% {
        opacity: 0;
        transform: scale(0) rotate(360deg);
    }
}

.card-draw-effect {
    position: absolute;
    width: 80px;
    height: 120px;
    background: linear-gradient(45deg, #3498db, #2980b9);
    border-radius: 8px;
    animation: cardDraw 0.5s ease-out forwards;
}

@keyframes cardDraw {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(50px);
    }
    50% {
        opacity: 1;
        transform: scale(1.1) translateY(-10px);
    }
    100% {
        opacity: 0;
        transform: scale(1) translateY(0);
    }
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .start-container, .end-container {
        padding: 40px 20px;
        margin: 20px;
    }
    
    .game-title {
        font-size: 2.5em;
    }
    
    .end-title {
        font-size: 2em;
    }
    
    .card-animation {
        gap: 15px;
    }
    
    .floating-card {
        width: 50px;
        height: 75px;
        font-size: 1em;
    }
    
    .game-container {
        padding: 10px;
    }
    
    .card {
        width: 60px;
        height: 90px;
        font-size: 0.8em;
    }
    
    .hand {
        gap: 5px;
    }
    
    .player-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .action-btn {
        width: 200px;
    }
    
    .end-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .restart-btn, .menu-btn {
        width: 200px;
    }
}
