:root {
    --bg-dark: #f0f4f8;
    --bg-card: #ffffff;
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --accent-red: #ff7675;
    --accent-orange: #fab1a0;
    --accent-blue: #74b9ff;
    --accent-green: #55efc4;
    --border-light: #dfe6e9;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

main {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(10px);
}

.view.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.main-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 15px;
}

.app-logo {
    width: 48px;
    height: 48px;
    margin-bottom: 4px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.05));
}

header h1 {
    font-size: 1.4rem;
    margin: 0;
    margin-bottom: 0px;
    background: linear-gradient(to right, var(--accent-red), var(--accent-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-size: 0.85rem;
    padding: 0 10px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.nav-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.nav-card:first-child {
    grid-column: span 2;
    flex-direction: row;
    text-align: left;
    gap: 15px;
    padding: 18px 20px;
}

.nav-card:active {
    transform: scale(0.97);
    background: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.nav-card i {
    width: 28px;
    height: 28px;
    margin-bottom: 8px;
}

.nav-card:first-child i {
    margin-bottom: 0;
}

.nav-card span {
    font-size: 1.1rem;
    font-weight: 600;
    display: block;
}

.nav-card small {
    color: var(--text-secondary);
    margin-top: 4px;
}

.icon-red { color: var(--accent-red); }
.icon-orange { color: var(--accent-orange); }
.icon-blue { color: var(--accent-blue); }

/* Navigation */
.bottom-nav {
    height: calc(70px + var(--safe-area-bottom));
    background: #ffffff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: var(--safe-area-bottom);
    border-top: 1px solid var(--border-light);
    z-index: 100;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.03);
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    gap: 4px;
    flex: 1;
}

.nav-item.active {
    color: var(--accent-red);
}

.nav-item i {
    width: 20px;
    height: 20px;
}

/* Incinerate View */
.view-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.view-header h2 {
    margin: 0;
    font-size: 1.5rem;
    flex: 1;
}

.back-btn, .icon-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.vent-area {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 15px;
}

#vent-input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 15px;
    color: var(--text-primary);
    font-size: 1.1rem;
    resize: none;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.action-btn {
    padding: 18px;
    border-radius: 12px;
    border: none;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
}

.action-btn.burn {
    background: linear-gradient(to right, #ff416c, #ff4b2b);
    color: white;
}

#fire-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255, 69, 0, 0.4) 0%, transparent 70%);
    z-index: 50;
    opacity: 0;
    transition: opacity 0.5s;
}

#fire-overlay.burning {
    opacity: 1;
}

/* Shatter View */
.smash-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding-bottom: 20px;
}

.plate {
    aspect-ratio: 1;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.1s;
    border: 1px solid #f0f0f0;
}

.plate:active {
    transform: scale(0.9);
}

.plate.broken {
    background: transparent;
    box-shadow: none;
}

.plate img {
    width: 80%;
    height: auto;
}

/* Breathing View */
.breathing-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

.circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-blue) 0%, transparent 100%);
    box-shadow: 0 0 50px var(--accent-blue);
    transition: transform 4s ease-in-out;
}

.circle.expand {
    transform: scale(2.2);
}

.circle.shrink {
    transform: scale(1);
}

#breathing-text {
    font-size: 2rem;
    font-weight: 300;
}

.breathing-timer {
    color: var(--text-secondary);
}

/* Animations */
@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.shake {
    animation: shake 0.5s;
}