* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #050505;
    color: #f5f5f5;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    padding: 10px 16px;
    font-size: 18px;
    font-weight: 600;
    background: #111111;
    border-bottom: 1px solid #1f1f1f;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

header span {
    pointer-events: none;
}

.back-btn {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: #1c1c1e;
    color: #f5f5f5;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.back-btn:active {
    background: #2c2c2e;
}

main {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h2 {
    margin-top: 8px;
    margin-bottom: 4px;
    font-size: 20px;
}

p {
    margin-top: 4px;
    font-size: 14px;
    color: #b0b0b0;
}

#video {
    width: 100%;
    max-width: 480px;
    max-height: 60vh;
    background: #000;
    border-radius: 16px;
    margin-top: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7);
}

.btn {
    margin-top: 10px;
    padding: 14px 22px;
    font-size: 16px;
    border: none;
    border-radius: 999px;
    background: #0a84ff;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    min-width: 200px;
    box-shadow: 0 6px 12px rgba(10, 132, 255, 0.4);
}

.btn:active {
    box-shadow: 0 3px 6px rgba(10, 132, 255, 0.6);
    transform: translateY(1px);
}

.btn-secondary {
    background: #1c1c1e;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
}

.btn-secondary:active {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}

.btn-danger {
    background: #ff3b30;
    box-shadow: 0 6px 12px rgba(255, 59, 48, 0.4);
}

.btn-small {
    padding: px 12px;
    font-size: 12px;
    min-width: auto;
    box-shadow: 0 3px 6px rgba(10, 132, 255, 0.4);
}

.links {
    margin-top: 12px;
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.links a,
.links button {
    width: 100%;
}

#status {
    margin-top: 16px;
    font-size: 14px;
    color: #d0d0d0;
}

footer {
    padding: 8px 16px;
    font-size: 12px;
    color: #666;
}

/* hidden canvas for jsQR fallback */
#qr-canvas {
    display: none;
}

/* Splash overlay */
#ppm-splash {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top, #1ca34a 0, #050505 55%, #000000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.ppm-splash-inner {
    text-align: center;
    color: #f5f5f5;
    padding: 24px;
}

.ppm-splash-logo {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    margin-bottom: 16px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.6);
}

.ppm-splash-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.ppm-splash-subtitle {
    font-size: 14px;
    color: #e0ffe8;
    margin-top: 4px;
    margin-bottom: 22px;
}

.ppm-splash-btn {
    min-width: 220px;
}

/* Bottom-aligned action buttons */
.bottom-actions {
    position: fixed;
    bottom: 24px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    z-index: 50;
}

.bottom-actions .btn {
    width: 100%;
    max-width: 320px;
}

#ppm-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    background: rgba(235, 200, 104, 0.8);
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    opacity: 0;
    transition: 0.25s ease;
    z-index: 9999;
    pointer-events: none;
}

#ppm-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0%);
}

.current-plant {
    margin-top: 6px;
    margin-bottom: 18px;
    color: #a8ffbf;
    font-size: 15px;
    line-height: 1.4;
}

.current-plant small {
    color: #74d48f;
}
