:root {
    --primary: #007AFF;
    --primary-hover: #005bb5;
    --danger: #FF3B30;
    --danger-hover: #d70015;
    --text-main: #1c1c1e;
    --text-muted: #8e8e93;
    --bg-body: #f2f2f7;
    --bg-container: rgba(255, 255, 255, 0.85);
    --border-color: rgba(255, 255, 255, 0.4);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    margin: 0;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.app-wrapper {
    flex: 1;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    cursor: pointer; /* Indicates the background is clickable */
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}
/* Bubble Background */
.bubble-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.bubble {
    position: absolute;
    border-radius: 50%;
    background: rgba(0, 122, 255, 0.08);
    animation: float 15s infinite ease-in-out alternate;
    filter: blur(40px);
}
.bubble-1 { width: 400px; height: 400px; top: -100px; left: -100px; }
.bubble-2 { width: 500px; height: 500px; bottom: -150px; right: -100px; animation-delay: -2s; background: rgba(52, 199, 89, 0.08); }
.bubble-3 { width: 300px; height: 300px; bottom: 20%; left: 20%; animation-delay: -5s; background: rgba(255, 59, 48, 0.05); }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, -50px) scale(1.1); }
}
.container {
    background: var(--bg-container);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 500px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: default;
    z-index: 1;
}
h1 {
    margin-top: 0;
    color: var(--text-main);
    text-align: center;
    margin-bottom: 5px;
    font-weight: 700;
}
.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 14px;
}
.counter-display {
    font-size: 120px;
    font-weight: 700;
    color: var(--primary);
    margin: 10px 0 30px 0;
    text-align: center;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    width: 100%;
    word-wrap: break-word;
    transition: transform 0.1s;
    text-shadow: 0 4px 15px rgba(0, 122, 255, 0.15);
}
.options {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    font-size: 13px;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.6);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    width: 100%;
    box-sizing: border-box;
}
.options label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    cursor: default;
}
input[type="number"], input[type="text"] {
    padding: 6px 10px;
    border: 1px solid #d1d1d6;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    text-align: center;
    transition: all 0.2s;
    color: var(--text-main);
    font-weight: 600;
    user-select: auto;
    cursor: text;
    background: rgba(255, 255, 255, 0.8);
}
input[type="number"] {
    width: 50px;
}
input[type="text"] {
    width: 100px;
}
input[type="number"]:focus, input[type="text"]:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
    background: #fff;
}
.controls {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}
.row {
    display: flex;
    gap: 10px;
    width: auto;
}
button {
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    transition: background 0.3s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
button:active {
    transform: scale(0.96);
}
.btn-primary {
    background-color: var(--primary);
    color: white;
    padding: 12px 24px;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
}
.btn-secondary {
    background-color: #e5e5ea;
    color: var(--text-main);
}
.btn-secondary:hover {
    background-color: #d1d1d6;
}
.btn-danger {
    background-color: var(--danger);
    color: white;
    box-shadow: 0 4px 10px rgba(255, 59, 48, 0.2);
}
.btn-danger:hover {
    background-color: var(--danger-hover);
}

@media (max-width: 480px) {
    .counter-display {
        font-size: 90px;
    }
}
.floating-text {
    position: fixed;
    color: #34C759;
    font-size: 20px;
    font-weight: bold;
    pointer-events: none;
    animation: floatUp 0.8s ease-out forwards;
    z-index: 9999;
    transform: translate(-50%, -50%);
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.floating-text.negative {
    color: var(--danger);
}
@keyframes floatUp {
    0% { opacity: 1; margin-top: 0; }
    100% { opacity: 0; margin-top: -60px; }
}