/* ===== CORRUPTION THEME STYLES ===== */
/* Phase 6: Visual & UI Integration for Corruption System */

/* ===== HEX GRID CORRUPTION STATES ===== */

.grid-cell.corrupted {
    filter: drop-shadow(0 0 15px rgba(255, 0, 51, 0.8)) !important;
    animation: corruptionPulse 2s infinite ease-in-out;
}

.grid-cell.odd-row.corrupted {
    animation: corruptionPulseOddRow 2s infinite ease-in-out;
}

.grid-cell.corrupted::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.grid-cell.threatened {
    filter: drop-shadow(0 0 10px rgba(255, 170, 0, 0.6)) !important;
    animation: threatenedPulse 3s infinite ease-in-out;
}

.grid-cell.odd-row.threatened {
    animation: threatenedPulseOddRow 3s infinite ease-in-out;
}

.grid-cell.fortified {
    filter: drop-shadow(0 0 10px rgba(0, 255, 136, 0.7)) !important;
    animation: fortifiedGlow 2.5s infinite ease-in-out;
}

.grid-cell.odd-row.fortified {
    animation: fortifiedGlowOddRow 2.5s infinite ease-in-out;
}

.grid-cell.under-siege {
    filter: drop-shadow(0 0 20px rgba(0, 255, 255, 0.9)) !important;
    animation: siegePulse 1s infinite ease-in-out;
}

.grid-cell.odd-row.under-siege {
    animation: siegePulseOddRow 1s infinite ease-in-out;
}

.grid-cell.under-siege::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, rgba(255, 0, 51, 0.4), rgba(102, 0, 17, 0.6));
    pointer-events: none;
    z-index: 1;
}

/* ===== CORRUPTION OVERLAY ===== */

.corruption-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
}

.corruption-strength {
    font-size: 0.9rem;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 0 8px #ff0033, 0 0 12px #ff0033, 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* ===== ANIMATIONS ===== */

@keyframes corruptionPulse {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

@keyframes corruptionPulseOddRow {
    0%, 100% {
        opacity: 0.8;
        transform: translateX(var(--odd-row-offset, 62px)) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateX(var(--odd-row-offset, 62px)) scale(1.05);
    }
}

@keyframes threatenedPulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 170, 0, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 170, 0, 0.8);
        transform: scale(1.02);
    }
}

@keyframes threatenedPulseOddRow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 170, 0, 0.4);
        transform: translateX(var(--odd-row-offset, 62px)) scale(1);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 170, 0, 0.8);
        transform: translateX(var(--odd-row-offset, 62px)) scale(1.02);
    }
}

@keyframes fortifiedGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 136, 1);
        transform: scale(1.02);
    }
}

@keyframes fortifiedGlowOddRow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
        transform: translateX(var(--odd-row-offset, 62px)) scale(1);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 136, 1);
        transform: translateX(var(--odd-row-offset, 62px)) scale(1.02);
    }
}

@keyframes siegePulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 255, 255, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 255, 255, 1);
        transform: scale(1.03);
    }
}

@keyframes siegePulseOddRow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 255, 255, 0.7);
        transform: translateX(var(--odd-row-offset, 62px)) scale(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 255, 255, 1);
        transform: translateX(var(--odd-row-offset, 62px)) scale(1.03);
    }
}

/* ===== CORRUPTION DIALOG STYLES ===== */

.corruption-dialog {
    min-width: 400px;
}

.corruption-status {
    background: rgba(255, 0, 51, 0.1);
    border-left: 4px solid #ff0033;
}

.corruption-state {
    color: #ff3366;
    font-weight: 600;
}

.cleanse-option {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.cleanse-option:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
}

.option-title {
    color: #00ffff;
    margin-bottom: 0.5rem;
}

.cost-badges .rz-badge {
    font-size: 0.85rem;
    padding: 4px 8px;
}

.security-center-option {
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.2);
    margin-top: 0.5rem;
    padding: 0.75rem;
}

/* ===== PATTERN MINI-GAME STYLES ===== */

.corruption-pattern-dialog {
    min-width: 500px;
}

.corruption-info {
    background: rgba(255, 0, 51, 0.1);
    border-left: 4px solid #ff0033;
}

.cost-display {
    background: rgba(0, 0, 0, 0.3);
}

.pattern-grid-container {
    background: rgba(0, 0, 0, 0.5);
    padding: 1rem;
}

.pattern-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 8px;
    max-width: 400px;
    margin: 0 auto;
}

.pattern-grid-small {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 4px;
    max-width: 200px;
    margin: 0 auto;
}

.pattern-tile {
    aspect-ratio: 1;
    background: rgba(0, 255, 255, 0.1);
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 2rem;
    color: #00ffff;
    user-select: none;
}

.pattern-tile:hover:not(:disabled) {
    background: rgba(0, 255, 255, 0.2);
    border-color: rgba(0, 255, 255, 0.6);
    transform: scale(1.05);
}

.pattern-tile:active:not(:disabled) {
    transform: scale(0.95);
}

.pattern-tile:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.pattern-tile-correct {
    background: rgba(0, 255, 136, 0.3);
    border-color: #00ff88;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
    animation: correctTileGlow 1s infinite ease-in-out;
}

.pattern-tile-small {
    aspect-ratio: 1;
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #00ffff;
}

.pattern-symbol {
    font-weight: bold;
    text-shadow: 0 0 5px currentColor;
}

@keyframes correctTileGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 136, 0.8);
    }
}

.target-pattern-preview {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 255, 0.2);
}

/* ===== SIEGE PROGRESS STYLES ===== */

.siege-progress-card {
    background: rgba(0, 255, 255, 0.1);
    border-left: 4px solid #00ffff;
}

.siege-target-info {
    color: #ffaa00;
    font-weight: 600;
}

.siege-progress-bar {
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
}

.siege-boost-button {
    background: linear-gradient(135deg, #00ffff, #0088ff);
    border: none;
    color: #000;
    font-weight: bold;
    transition: all 0.3s ease;
}

.siege-boost-button:hover {
    background: linear-gradient(135deg, #00ffff, #00aaff);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    transform: scale(1.05);
}

/* ===== INFECTED BLOCK INDICATOR ===== */

.block-infected {
    border: 2px solid #ff0033;
    box-shadow: 0 0 15px rgba(255, 0, 51, 0.8);
    opacity: 0.6;
    animation: infectedPulse 2s infinite ease-in-out;
}

@keyframes infectedPulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.8;
    }
}

.block-infected-label {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ff0033;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 20;
    box-shadow: 0 0 10px rgba(255, 0, 51, 0.8);
}

/* ===== DEFENSE RADIUS VISUALIZATION ===== */

.defense-radius-indicator {
    position: absolute;
    pointer-events: none;
    border: 2px dashed #00ff88;
    border-radius: 50%;
    opacity: 0.4;
    animation: defenseRadiusPulse 3s infinite ease-in-out;
}

@keyframes defenseRadiusPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.05);
    }
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */

@media (max-width: 768px) {
    .pattern-grid {
        max-width: 300px;
        grid-gap: 6px;
    }

    .pattern-tile {
        font-size: 1.5rem;
    }

    .corruption-dialog {
        min-width: 300px;
    }

    .corruption-pattern-dialog {
        min-width: 350px;
    }
}
/* ===== CIPHER BREACH MINI-GAME STYLES ===== */

.corruption-cipher-dialog {
	min-width: 500px;
}

.cipher-wheels-container {
	background: rgba(0, 0, 0, 0.5);
	padding: 1.5rem;
}

.cipher-wheels {
	display: flex;
	justify-content: center;
	gap: 2rem;
}

.cipher-wheel-column {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
}

.cipher-rotate-btn {
	background: rgba(0, 255, 255, 0.1);
	border: 2px solid rgba(0, 255, 255, 0.3);
	color: #00ffff;
	font-size: 1.2rem;
	width: 50px;
	height: 35px;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.cipher-rotate-btn:hover:not(:disabled) {
	background: rgba(0, 255, 255, 0.2);
	border-color: rgba(0, 255, 255, 0.6);
	transform: scale(1.05);
}

.cipher-rotate-btn:active:not(:disabled) {
	transform: scale(0.95);
}

.cipher-rotate-btn:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

.cipher-wheel {
	width: 120px;
	height: 120px;
	background: rgba(0, 255, 255, 0.1);
	border: 3px solid rgba(0, 255, 255, 0.3);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 3rem;
	font-weight: bold;
	color: #00ffff;
	text-shadow: 0 0 10px currentColor;
	transition: all 0.3s ease;
	user-select: none;
}

.cipher-wheel-correct {
	background: rgba(0, 255, 136, 0.2);
	border-color: #00ff88;
	color: #00ff88;
	box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
	animation: correctTileGlow 1s infinite ease-in-out;
}

.target-sequence {
	background: rgba(0, 0, 0, 0.4);
	border: 1px solid rgba(0, 255, 255, 0.2);
}

.target-symbols {
	display: flex;
	justify-content: center;
	gap: 1.5rem;
}

.target-symbol-box {
	width: 80px;
	height: 80px;
	background: rgba(0, 255, 255, 0.05);
	border: 2px solid rgba(0, 255, 255, 0.2);
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 2.5rem;
	font-weight: bold;
	color: #ffaa00;
	text-shadow: 0 0 10px currentColor;
	user-select: none;
}

.target-box-matched {
	border-color: #00ff88;
	box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
	color: #00ff88;
}

/* ===== DATA STREAM ROUTER MINI-GAME STYLES ===== */

.corruption-router-dialog {
	min-width: 500px;
}

.router-grid-container {
	background: rgba(0, 0, 0, 0.5);
	padding: 1.5rem;
}

.router-grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	grid-gap: 8px;
	max-width: 400px;
	margin: 0 auto;
}

.router-cell {
	aspect-ratio: 1;
	background: rgba(0, 255, 255, 0.1);
	border: 2px solid rgba(0, 255, 255, 0.3);
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.2rem;
	font-weight: bold;
	cursor: pointer;
	transition: all 0.2s ease;
	user-select: none;
}

.router-cell:hover:not(:disabled) {
	background: rgba(0, 255, 255, 0.2);
	border-color: rgba(0, 255, 255, 0.6);
	transform: scale(1.05);
}

.router-cell:active:not(:disabled) {
	transform: scale(0.95);
}

.router-cell:disabled {
	cursor: default;
}

.router-cell-source {
	background: rgba(0, 255, 136, 0.2);
	border-color: #00ff88;
	color: #00ff88;
	text-shadow: 0 0 10px currentColor;
	box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
	cursor: not-allowed;
}

.router-cell-destination {
	background: rgba(255, 0, 255, 0.2);
	border-color: #ff00ff;
	color: #ff00ff;
	text-shadow: 0 0 10px currentColor;
	box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
	cursor: not-allowed;
}

.router-cell-corrupted {
	background: rgba(255, 0, 51, 0.2);
	border-color: #ff0033;
	color: #ff0033;
	text-shadow: 0 0 10px currentColor;
	box-shadow: 0 0 15px rgba(255, 0, 51, 0.3);
	cursor: not-allowed;
	animation: corruptionPulse 2s infinite ease-in-out;
}

.router-cell-path {
	background: rgba(0, 255, 255, 0.3);
	border-color: #00ffff;
	color: #00ffff;
	text-shadow: 0 0 10px currentColor;
	box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
}

.router-legend {
	background: rgba(0, 0, 0, 0.4);
	border: 1px solid rgba(0, 255, 255, 0.2);
	padding: 0.75rem;
	border-radius: 4px;
}

/* ===== ZONE VISUAL STYLES ===== */
/* Zones use drop-shadow filters to create a subtle glow, similar to corruption */

/* Public Network Zone - Green glow */
.grid-cell.zone-public-network.zone-unlocked {
    filter: drop-shadow(0 0 8px rgba(27, 94, 32, 0.5)) !important;
}

/* Corporate Network Zone - Blue glow */
.grid-cell.zone-corporate-network.zone-unlocked {
    filter: drop-shadow(0 0 8px rgba(21, 101, 192, 0.5)) !important;
}

/* Research Network Zone - Purple glow */
.grid-cell.zone-research-network.zone-unlocked {
    filter: drop-shadow(0 0 8px rgba(106, 27, 154, 0.5)) !important;
}

/* Government Network Zone - Red glow */
.grid-cell.zone-government-network.zone-unlocked {
    filter: drop-shadow(0 0 8px rgba(183, 28, 28, 0.5)) !important;
}

/* Locked zones have a dimmer glow */
.grid-cell.zone-locked {
    filter: drop-shadow(0 0 4px rgba(128, 128, 128, 0.3)) !important;
    opacity: 0.7;
}

/* ===== RESPONSIVE ADJUSTMENTS FOR NEW MINI-GAMES ===== */

@media (max-width: 768px) {
	.cipher-wheels {
		gap: 1rem;
	}

	.cipher-wheel {
		width: 90px;
		height: 90px;
		font-size: 2rem;
	}

	.target-symbol-box {
		width: 60px;
		height: 60px;
		font-size: 1.8rem;
	}

	.router-grid {
		max-width: 300px;
		grid-gap: 6px;
	}

	.router-cell {
		font-size: 1rem;
	}

	.corruption-cipher-dialog,
	.corruption-router-dialog {
		min-width: 350px;
	}
}
