
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: "Noto Sans HK", sans-serif;
	background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
	min-height: 100vh;
	color: #e0e0e0;
	padding: 20px;
}

.backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../images/bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -1; /* Keep it behind content */
}

.container {
	max-width: 1000px;
	margin: 0 auto;
	text-align: center;
}

h1 {
	font-size: 2em;
	margin-bottom: 40px;
	margin-top: 20px;
	color: #f0c040;
	text-shadow: 0 0 10px rgba(240, 192, 64, 0.3);
}

/* Start Page */

@keyframes fadeInScenario {
    from {
        opacity: 0;
		transform: translateY(10px);
    }
    to {
        opacity: 1;
		transform: translateY(0px);
    }
}

.scenario-text {
    opacity: 0;
}

.scenario-text.show {
    animation: fadeInScenario 0.85s ease forwards;
}


.scenario-box {
	background: rgba(255, 255, 255, 0.0);
	border-top: 2px solid rgba(240, 192, 64, 0.5);
	border-bottom: 2px solid rgba(240, 192, 64, 0.5);
	border-radius: 12px;
	padding: 20px 62px;
	margin-bottom: 40px;
	position: relative;
	min-height:140px;
}

.scenario-label {
	font-size: 0.9em;
	color: #f0c040;
	text-transform: uppercase;
	letter-spacing: 2px;
	margin-bottom: 10px;
}

.scenario-text {
	font-size: 1.1em;
	line-height: 1.7;
	color: #fff;
}

.scenario-tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 0;
}

.tab-btn {
	width: 46%;
    padding: 10px 24px;
    font-size: 0.9em;
    font-family: inherit;
    border: 1px solid rgba(240, 192, 64, 0.3);
    background: transparent;
    color: #888;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:first-child {
    border-radius: 12px 0 0 0;
    border-right: none;
}

.tab-btn:last-child {
    border-radius: 0 12px 0 0;
}

.tab-btn.active {
    background: rgba(240, 192, 64, 0.15);
    color: #f0c040;
	font-weight: bold;
    border-color: rgba(240, 192, 64, 0.3);
}

.scenario-box {
    
}

.scenario-input {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    font-family: inherit;
    font-size: 1.1em;
    line-height: 1.7;
    color: #e8e8e8;
    background: transparent;
    border: 1px solid rgba(240, 192, 64, .3);
	background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    resize: vertical;
    outline: none;
    transition: border-color 0.3s;
}

.scenario-input:focus {
    border-color: #f0c040;
}

.scenario-input::placeholder {
    color: #666;
}

.scenario-input.error {
    border-color: #e07070;
    animation: shake 0.3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.custom-spread-inputs {
    display: flex;
    justify-content: right;
    gap: 5px;
    margin-top: 15px;
    flex-wrap: wrap;
	align-items: center;
	
}

.custom-position-input {
    width: 100px;
    padding: 8px 12px;
    font-size: 0.9em;
    text-align: center;
    color: #e8e8e8;
	background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(240, 192, 64, .3);
    border-radius: 6px;
    outline: none;
    transition: border-color 0.3s;
    font-family: inherit;
}

.custom-position-input:focus {
    border-color: #f0c040;
}

.custom-position-input.error {
    border-color: #e07070;
    animation: shake 0.3s;
}



.btn-refresh {
	position: absolute;
	top: 12px;
	right: 12px;
	background: transparent;
	border: 1px solid rgba(240, 192, 64, 0.4);
	color: #f0c040;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 1em;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s;
}

.btn-refresh:hover {
	background: rgba(240, 192, 64, 0.1);
	transform: rotate(90deg);
}

.btn-refresh:active {
	background: rgba(240, 192, 64, 0.2);
	transform: rotate(270deg);
}


.options-section {
	margin-bottom: 40px;
}

.option-group {
	margin-bottom: 20px;
}

.option-label {
	font-size: 1em;
	color: #fff;
	margin-bottom: 10px;
	display: block;
}

.spread-options {
	display: flex;
	justify-content: center;
	gap: 25px;
	flex-wrap: wrap;
}

.spread-btn {
	width: 200px;
	padding: 10px 18px;
	border: 0px solid #444;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.03);
	color: #888;
	cursor: pointer;
	transition: all 0.3s;
	font-family: inherit;
	font-size: 1.1em;
}

.spread-btn:hover {
	border-color: #f0c040;
	color: #f0c040;
}

.spread-btn.active {
	border-color: #f0c040;
	background: rgba(240, 192, 64, 0.15);
	color: #f0c040;
}

.spread-btn .spread-name {
	font-weight: bold;
	display: block;
	margin-bottom: 4px;
}

.spread-btn .spread-desc {
	font-size: 0.8em;
	
}

.spread-btn.active .spread-desc {
	color: #c9a630;
}

.toggle-container {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
	margin-bottom: 30px;
}

.toggle-label {
	font-size: 1em;
	color: #fff;
}

.toggle-switch {
	position: relative;
	width: 46px;
	height: 24px;
	background: rgba(255, 255, 255, 0.09);
	border-radius: 12px;
	cursor: pointer;
	transition: background 0.3s;
}

.toggle-switch.active {
	background: #f0c040;
}

.toggle-switch::after {
	content: '';
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.3s;
}

.toggle-switch.active::after {
	transform: translateX(22px);
}

.btn {
	padding: 14px 40px;
	font-size: 1.1em;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-family: inherit;
	transition: all 0.3s;
}

.btn-start {
	background: linear-gradient(135deg, #f0c040, #e6a000);
	color: #1a1a2e;
	font-weight: bold;
	box-shadow: 0 4px 15px rgba(240, 192, 64, 0.3);
	width:200px;
}

.btn-start:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(240, 192, 64, 0.5);
}

/* Cards Page */
.spread-type-label {
	font-size: 1em;
	color: #fff;
	margin-bottom: 20px;
	letter-spacing: 1px;
}

.cards-scenario {
	font-size: 1.1em;
	line-height: 1.7;
	color: #fff;
}

.spread {
	display: flex;
	justify-content: center;
	gap: 24px;
	margin-bottom: 40px;
	flex-wrap: wrap;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-slot {
    opacity: 0;
}

.card-slot.show {
    animation: fadeIn 0.6s ease forwards;
}

.card-slot:nth-child(1).show {
    animation-delay: 0.1s;
}

.card-slot:nth-child(2).show {
    animation-delay: 0.3s;
}

.card-slot:nth-child(3).show {
    animation-delay: 0.5s;
}



.card-slot {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 250px;
}

.card-position {
	font-size: 1.1em;
	color: #f0c040;
	margin-bottom: 8px;
	letter-spacing: 1px;
	font-weight: bold;
}

.card-img-container {
	width: 200px;
	height: 348px;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
	margin-bottom: 10px;
	background: #d8c3ac;
	display: flex;
	align-items: center;
	justify-content: center;
}

.card-img-container img {
	width: 103%;
	height: 101%;
	object-fit: cover;
}

.card-img-container img.reversed {
	transform: rotate(180deg);
}

.card-name {
	font-size: 0.95em;
	color: #fff;
	font-weight: bold;
	margin-bottom: 4px;
}

.card-orientation {
	font-size: 0.9em;
	margin-bottom: 8px;
}

.card-orientation.upright {
	color: #7a8db0;
}

.card-orientation.reversed {
	color: #ca8888;
}

.btn-hint {
	background: transparent;
	border: 1px solid #555;
	color: #999;
	font-size: 0.8em;
	padding: 5px 12px;
	border-radius: 6px;
	cursor: pointer;
	font-family: inherit;
	transition: all 0.3s;
}

.btn-hint:hover {
	border-color: #f0c040;
	color: #f0c040;
}

.hint-box {
	background: rgba(240, 192, 64, 0.08);
	border: 1px solid rgba(240, 192, 64, 0.2);
	border-radius: 6px;
	padding: 10px 12px;
	margin-top: 8px;
	text-align: left;
	font-size: 0.8em;
	line-height: 1.5;
	color: #ccc;
	display: none;
	max-width: 200px;
}
.btn-restart {
	background: linear-gradient(135deg, #f0c040, #e6a000);
	color: #1a1a2e;
	font-weight: bold;
	box-shadow: 0 4px 15px rgba(240, 192, 64, 0.3);
	width: 250px;
}

.btn-restart:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(240, 192, 64, 0.5);
}


.page {
	display: none;
}

.page.active {
	display: block;
}
.copyright{
	font-size: 0.8em;
	color: #aaa;
	margin-top: 15px;
}

.copyright-link {
	font-size: 0.8em;
	color: #aaa;
	text-decoration: none;
	}
.copyright-link:hover {
	color: #aaa;
}


@media (max-width: 930px) {
	.custom-spread-inputs {
		justify-content: center;
	}
	.custom-position-input {
		width: 90px;
	}
}

@media (max-width: 700px) {
	.spread {
		flex-direction: column;
		align-items: center;
		gap: 50px;
	}

	.card-slot {
		width: 100%;
		max-width: 300px;
	}
	
	.card-img-container {
		width: 250px;
		height: 433px;
		border-radius: 8px;
	}
	
	
	.spread-options {
		flex-direction: column;
		align-items: center;
	}

	h1 {
		font-size: 1.6em;
	}
	.scenario-input {
		min-height: 160px;
	}
	.scenario-box {
		padding: 20px 10px;
	}
}
