*,
*::before,
*::after { box-sizing: border-box; }

html, body {
	height: 100%;
}

body {
	margin: 0;
	font-family: Poppins, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
	color: var(--text);
	background: var(--bg-page);
	min-height: 100vh;
}

.app-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
}

.app-title {
	margin: 0;
	display: flex;
	align-items: center;
	gap: 8px;
}

.app-logo {
	display: block;
	height: 60px;
	width: auto;
}
.ice-cube {
    width: 250px;
    height: auto;
    display: block;
    align-items: center;
}
.header-actions {
	display: flex;
	gap: 12px;
	align-items: center;
}

.app-footer {
	display: none;
}

.app-main {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: calc(100vh - 80px);
	padding: 40px 20px;
}

.app-main.minimalist {
	display: flex;
	align-items: center;
	justify-content: center;
}

.focus-stack {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 32px;
	max-width: 600px;
	width: 100%;
}

.panel {
	background: var(--bg-panel);
	border: 1px solid var(--border);
	border-radius: 12px;
	box-shadow: 0 20px 50px rgba(0,0,0,0.04);
	padding: 16px;
}

.controls .timer-form {
	display: grid;
	gap: 12px;
}
.field {
	display: grid;
	gap: 6px;
}
.field span {
	color: var(--muted);
	font-size: 12px;
}
input[type="number"], input[type="text"], select {
	width: 100%;
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 10px 12px;
	background: var(--cream-300);
	font-family: inherit;
	font-size: 14px;
}
input[type="text"]::placeholder {
	color: var(--muted);
	opacity: 0.6;
}
input:focus, select:focus, button:focus {
	outline: 2px solid var(--focus);
	outline-offset: 2px;
}
input.error {
	border-color: #c05454;
	box-shadow: 0 0 0 2px rgba(192, 84, 84, 0.18);
}
.actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 8px;
}

.btn {
	border: none;
	border-radius: 8px;
	padding: 12px 24px;
	font-weight: 600;
	font-size: 15px;
	cursor: pointer;
	transition: transform .06s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
	font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { 
	background: #fff; 
	color: #000; 
	border: 1px solid #e1e5ec;
	min-width: 120px;
}
.btn-primary:hover { 
	background: #fafafa; 
	border-color: #d0d5dc;
}
.btn-secondary { 
	background: var(--secondary); 
	color: #fff; 
	border: 1px solid var(--secondary);
}
.btn-secondary:hover { 
	background: var(--secondary-strong); 
	border-color: var(--secondary-strong);
}
/*.btn-stamp { 
	background: transparent; 
	color: var(--secondary-strong); 
	border: 1px solid var(--secondary-strong); 
}
.btn-stamp:hover { 
	background: rgba(107, 123, 168, 0.1); 
} */

/* Royalty Card Button */
.royalty-card-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 16px;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 100;
}

.royalty-card-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.card-icon {
    font-size: 1.5rem;
}

.stamp-count {
    font-size: 1.2rem;
    font-weight: 700;
    color: #5C724A;
}

.stamp-count-label {
    font-size: 0.9rem;
    color: #888888;
}

/* Floating Stamp Animation */
.floating-stamp {
    position: fixed;
    font-size: 4rem;
    pointer-events: none;
    z-index: 1000;
    animation: floatUp 2s ease-out forwards;
}

@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.5) rotate(0deg);
    }
    20% {
        opacity: 1;
        transform: translateY(-50px) scale(1.2) rotate(15deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-300px) scale(0.8) rotate(360deg);
    }
}

/* Small stamp animation to button */
.stamp-to-button {
    position: fixed;
    font-size: 2rem;
    pointer-events: none;
    z-index: 1001;
    animation: flyToButton 1s ease-in-out forwards;
}

@keyframes flyToButton {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0.3);
    }
}

/* Stamp Modal */
.modal-overlayStamp {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 2001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlayStamp.active {
    display: flex;
    opacity: 1;
}

.modal {
    background: white;
    border-radius: 24px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlayStamp.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.8rem;
    color: #5C724A;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: #888888;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #f0f0f0;
    color: #484848;
    transform: none;
}

.stamp-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.stamp-slot {
    aspect-ratio: 1;
    border: 2px dashed #C8C8C8;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: #F5F1E8;
    transition: all 0.3s ease;
}

.stamp-slot.filled {
    border: 2px solid #7A9668;
    background: white;
    animation: stampPop 0.4s ease;
}

@keyframes stampPop {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

.stamp-slot.empty {
    opacity: 0.3;
}

.progress-bar {
    margin-top: 1.5rem;
    background: #E8E8E8;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7A9668, #9CAF88);
    transition: width 0.5s ease;
    border-radius: 6px;
}

.progress-text {
    text-align: center;
    margin-top: 0.5rem;
    color: #6B8459;
    font-weight: 600;
}

.reward-message {
    background: linear-gradient(135deg, #9CAF88, #7A9668);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    margin-top: 1rem;
    font-weight: 600;
    display: none;
}

.reward-message.show {
    display: block;
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.readout {
	display: grid;
	gap: 6px;
	margin-top: 8px;
}
/*.ice-frame {
	width: 100%;
	max-width: 400px;
	aspect-ratio: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

#iceCanvas {
	width: 100%;
	height: 100%;
	background: transparent;
	border: none;
} */

.time-display {
	font-variant-numeric: tabular-nums;
	font-size: 64px;
	font-weight: 700;
	color: #000;
	text-align: center;
	line-height: 1;
	letter-spacing: -1px;
}

.status-text {
	font-size: 14px;
	color: var(--muted);
	font-weight: 400;
	text-align: center;
	min-height: 20px;
}

.primary-actions {
	display: flex;
	gap: 12px;
	justify-content: center;
	align-items: center;
}

.link-button {
	background: none;
	border: none;
	color: var(--muted);
	font-size: 13px;
	cursor: pointer;
	padding: 8px;
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color 0.2s ease;
}

.link-button:hover {
	color: var(--text);
}

/* Controls drawer */
.controls-drawer {
	position: fixed;
	top: 0;
	right: 0;
	width: 380px;
	height: 100vh;
	background: #fff;
	box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
	transform: translateX(100%);
	transition: transform 0.3s ease;
	z-index: 1000;
	overflow-y: auto;
	padding: 24px;
}

.controls-drawer[aria-hidden="false"] {
	transform: translateX(0);
}

.controls-drawer h2 {
	margin: 0 0 24px 0;
	font-size: 20px;
	font-weight: 700;
	color: #000;
}

.drawer-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.3);
	z-index: 999;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.drawer-backdrop:not([hidden]) {
	opacity: 1;
	pointer-events: all;
}

/* Tablet and below */
@media (max-width: 1024px) {
	.app-main {
		min-height: calc(100vh - 70px);
		padding: 30px 20px;
	}
	
	.ice-frame {
		max-width: 350px;
	}
}

/* Mobile and small tablets */
@media (max-width: 768px) {
	.app-header {
		padding: 16px 20px;
	}
	
	.app-title {
		font-size: 20px;
	}
	
	.header-actions {
		gap: 8px;
	}
	
	.btn {
		padding: 10px 16px;
		font-size: 14px;
	}

	.royalty-card-btn{
		padding: 8px 14px;
	}
		
	.stamp-count{
    	display: none;
	}
	.stamp-count-label{
    	display: none;
	}
	
	/*.btn-stamp {
		padding: 8px 12px;
		font-size: 13px;
	}*/
	
	.app-main {
		min-height: calc(100vh - 60px);
		padding: 24px 16px;
	}
	
	.focus-stack {
		gap: 24px;
		max-width: 100%;
	}
	
	.ice-frame {
		max-width: 320px;
	}
	
	.time-display {
		font-size: 48px;
		letter-spacing: -0.5px;
	}
	
	.status-text {
		font-size: 13px;
	}
	
	.primary-actions {
		flex-wrap: wrap;
		gap: 10px;
		width: 100%;
	}
	
	.btn-primary {
		min-width: 100px;
		flex: 1;
		max-width: 140px;
	}
	
	.controls-drawer {
		width: 100%;
		padding: 20px;
	}
	
	.controls-drawer h2 {
		font-size: 18px;
		margin-bottom: 20px;
	}
}

/* Small mobile devices */
@media (max-width: 480px) {
	.app-header {
		padding: 12px 16px;
		flex-wrap: wrap;
		gap: 12px;
	}
	
	.app-title {
		font-size: 18px;
		width: 100%;
	}
	
	.header-actions {
		width: 100%;
		justify-content: space-between;
	}

	.stamp-count{
    	display: none;
	}
	.stamp-count-label{
    	display: none;
	}

	.royalty-card-btn {
		all: unset;              /* Removes ALL inherited styles */
		position: fixed;
		top: 12px;
		right: 12px;
		z-index: 100;
		cursor: pointer;
		display: block;
	}
	
	.card-icon {
		font-size: 38px;         /* Make emoji bigger since no button background */
		line-height: 1;
		display: block;
		top: 30px;
		right: 30px;
	}
	
/*	.btn-stamp {
		font-size: 12px;
		padding: 6px 10px;
	}*/
	
	.btn-secondary {
		font-size: 12px;
		padding: 6px 12px;
	}
	
	.app-main {
		padding: 20px 12px;
		min-height: calc(100vh - 100px);
	}
	
	.focus-stack {
		gap: 20px;
	}
	
	.ice-frame {
		max-width: 280px;
	}
	
	.time-display {
		font-size: 40px;
		letter-spacing: -0.3px;
	}
	
	.status-text {
		font-size: 12px;
	}
	
	.primary-actions {
		flex-direction: column;
		width: 100%;
		gap: 8px;
	}
	
	.btn {
		width: 100%;
		max-width: none;
		padding: 12px 20px;
		font-size: 15px;
	}
	
	.btn-primary {
		min-width: auto;
		max-width: none;
	}
	
	.link-button {
		font-size: 12px;
		padding: 6px;
	}
	
	.controls-drawer {
		padding: 16px;
	}
	
	.controls-drawer h2 {
		font-size: 16px;
		margin-bottom: 16px;
	}
	
	.field span {
		font-size: 11px;
	}
	
	input[type="number"], 
	input[type="text"], 
	select {
		padding: 10px;
		font-size: 14px;
	}
}

/* Very small devices */
@media (max-width: 395px) {
	.time-display {
		font-size: 36px;
	}
	
	.ice-frame {
		max-width: 240px;
	}
	
	.app-header {
		padding: 10px 12px;
	}
	
	.app-main {
		padding: 16px 10px;
	}

	.stamp-count{
    	display: none;
	}
	.stamp-count-label{
    	display: none;
	}

	.royalty-card-btn {
		all: unset;              /* Removes ALL inherited styles */
		position: fixed;
		top: 20px;
		right: 20px;
		z-index: 100;
		cursor: pointer;
		display: block;
	}
	
	.card-icon {
		font-size: 36px;         /* Make emoji bigger since no button background */
		line-height: 1;
		display: block;
		top: 30px;
		right: 30px;
	}

	.modal-saveBtn, .modal-cancelBtn {
        min-width: 80px;
        max-width: 120px;
        height: 28px;
        padding: 8px;
	}
}


.modalAdjustDrink {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Poppins', sans-serif;
    z-index: 2000;
}

.modalAdjustDrink.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 32px;  /* Overall container padding */
    margin: 20px;
    border-radius: 12px;
    max-width: 450px;
    width: 90%
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;  /* Aligns buttons to the right */
    margin-top: 24px;
    margin-right: 6px;
    margin-left: 6px;
}

.modal-saveBtn {
    flex: 1;
    background: #7A8BB8;
	min-width: 80px; 
    max-width: 200px; 
    height: 30px;
    padding: 10px;
    border-radius: 10px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    letter-spacing: 0.3px;
}

.modal-cancelBtn {
    flex: 1;
    background: #D6E1F0;
    min-width: 80px; 
    max-width: 200px;
    height: 30px;
    padding: 10px;
    border-radius: 10px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    letter-spacing: 0.3px;
}
