:root {
    --bg-color: #0f172a;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --nav-height: 65px;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: radial-gradient(circle at top right, #1e293b, var(--bg-color));
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.glass-header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
}

.glass-nav {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
}

#page-title {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Main Content Area */
#content-area {
    margin-top: var(--header-height);
    margin-bottom: var(--nav-height);
    height: calc(100vh - var(--header-height) - var(--nav-height));
    overflow-y: auto;
    padding: 20px;
    position: relative;
}

.view-section {
    display: none;
    animation: fadeIn 0.3s ease;
}
.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-title {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Hero Card */
.hero-card {
    padding: 30px 20px;
    text-align: center;
    background: linear-gradient(135deg, rgba(59,130,246,0.2) 0%, rgba(255,255,255,0.05) 100%);
}
.hero-card h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    background: -webkit-linear-gradient(45deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Grids */
.grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.grid-item {
    padding: 25px 15px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    position: relative;
}
.grid-item:active {
    transform: scale(0.95);
    background: rgba(255,255,255,0.1);
}
.grid-item i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 12px;
}
.grid-item span {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
}
.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #10b981;
    color: #fff;
    font-size: 0.65rem;
    padding: 3px 6px;
    border-radius: 10px;
    font-weight: bold;
}

/* Bottom Navigation */
.bottom-nav {
    height: var(--nav-height);
    position: fixed;
    bottom: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    transition: color 0.3s;
}
.nav-item i {
    font-size: 1.3rem;
    margin-bottom: 4px;
    transition: transform 0.3s, color 0.3s;
}
.nav-item.active {
    color: var(--primary);
}
.nav-item.active i {
    transform: translateY(-3px);
}

/* Chat Styles */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 220px);
    overflow: hidden;
}
#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.chat-msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 0.9rem;
    word-wrap: break-word;
}
.chat-msg.other {
    background: rgba(255,255,255,0.1);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.chat-msg.self {
    background: var(--primary);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.chat-msg .sender {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-bottom: 4px;
    display: block;
}
.chat-input-area {
    display: flex;
    padding: 15px;
    border-top: 1px solid var(--glass-border);
    gap: 10px;
}
.chat-input-area input {
    flex: 1;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 12px 15px;
    border-radius: 20px;
    outline: none;
}
.chat-input-area button {
    background: var(--primary);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}
.chat-input-area button:active {
    background: var(--primary-hover);
}

/* Transfer */
.transfer-container {
    padding: 30px 20px;
    text-align: center;
}
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid var(--glass-border);
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 20px;
    display: inline-block;
    text-decoration: none;
}

/* Modals */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 200;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.modal-content {
    width: 100%;
    max-width: 400px;
    height: 80vh;
    position: relative;
    padding: 20px;
    overflow-y: auto;
}
.modal-close {
    position: absolute;
    top: 15px; right: 15px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 30px; height: 30px;
    border-radius: 50%;
    cursor: pointer;
}

/* Game: Tic Tac Toe */
.ttt-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 30px;
}
.ttt-cell {
    aspect-ratio: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
}
.ttt-cell.x { color: #f43f5e; }
.ttt-cell.o { color: #3b82f6; }
.ttt-status {
    text-align: center;
    margin-top: 20px;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Tool: Calculator */
.calc-display {
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 20px;
    font-size: 2rem;
    text-align: right;
    margin-bottom: 20px;
    margin-top: 30px;
    overflow: hidden;
}
.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.calc-btn {
    padding: 15px 0;
    font-size: 1.2rem;
    border-radius: 12px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: white;
    cursor: pointer;
}
.calc-btn.op { background: var(--primary); }
.calc-btn.eq { grid-column: span 2; background: #10b981; }
