:root {
    --bg-color: #e0f2fe; 
    --header-bg: #0369a1; 
    --text-main: #1e293b;
    --bubble-left: #ffffff;
    --bubble-system: #bae6fd;
    --btn-blue: #0ea5e9;
    --btn-blue-hover: #0284c7;
    --btn-disabled: #94a3b8;
    --danger: #ef4444;
    --success: #10b981;
}

* { box-sizing: border-box; font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; }

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    background-color: #cbd5e1;
    display: flex;
    justify-content: center;
}

#app {
    width: 100%;
    max-width: 500px;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

header {
    background-color: var(--header-bg);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 18px;
    z-index: 10;
}

.info-btn {
    background: none; border: 2px solid white; color: white;
    border-radius: 50%; width: 28px; height: 28px;
    font-weight: bold; cursor: pointer; display: flex;
    align-items: center; justify-content: center;
}

#chat-window {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message { display: flex; gap: 10px; max-width: 90%; }
.message.system { margin: 0 auto; max-width: 100%; justify-content: center; }
.system .bubble { background-color: var(--bubble-system); font-size: 13px; text-align: center; color: #0369a1; font-weight: bold;}

.avatar { width: 40px; height: 40px; flex-shrink: 0; }
.bubble-container { display: flex; flex-direction: column; gap: 4px; }
.sender-name { font-size: 12px; font-weight: bold; color: #64748b; margin-left: 5px; }
.sender-name.officer { color: #0369a1; }

.bubble {
    background-color: var(--bubble-left);
    padding: 12px 16px;
    border-radius: 0 15px 15px 15px;
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.4;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

#controls {
    background-color: white;
    padding: 12px 15px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 80px;
    justify-content: center;
}

.hidden { display: none !important; }

.action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn {
    background-color: var(--btn-blue); color: white;
    border: none; padding: 12px; border-radius: 8px;
    font-size: 15px; font-weight: bold; cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-align: center; width: 100%;
}
.btn:active { transform: scale(0.98); }
.btn:hover { background-color: var(--btn-blue-hover); }
.btn:disabled { background-color: var(--btn-disabled); cursor: not-allowed; opacity: 0.7; }
.btn-outline { background: transparent; border: 2px solid var(--btn-blue); color: var(--btn-blue); }
.btn-danger { background-color: var(--danger); }
.btn-success { background-color: var(--success); }

.logo-area { text-align: center; padding: 20px; color: var(--header-bg); font-weight: bold; font-size: 24px; }

.seed-input-container { 
    display: flex; 
    gap: 8px; 
    margin-top: 10px; 
    width: 100%;
}
.seed-input { 
    flex: 1; 
    min-width: 0;
    padding: 10px; 
    border: 1px solid #cbd5e1; 
    border-radius: 8px; 
    font-size: 16px; 
    text-align: center; 
}
.btn-start-seed {
    flex-shrink: 0;
    width: auto;
    padding: 10px 15px;
}

#selection-sheet {
    display: none;
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 20;
    flex-direction: column;
    justify-content: flex-end;
    animation: fadeIn 0.2s ease-out;
}

.sheet-content {
    background: white;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 -5px 25px rgba(0,0,0,0.2);
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sheet-header { font-size: 18px; font-weight: bold; text-align: center; margin-bottom: 5px; }

.sheet-list { 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    overflow-y: auto; 
    max-height: 65vh; 
    padding-right: 5px; 
}

#rules-modal {
    display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 30; justify-content: center; align-items: center; padding: 20px;
}
.modal-content { background: white; padding: 25px; border-radius: 15px; max-height: 80vh; overflow-y: auto; }
.close-modal { margin-top: 15px; background: var(--btn-blue); color: white; padding: 10px; border: none; border-radius: 8px; width: 100%; cursor: pointer;}

@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }