:root {
    --accent: #34c759;
    --danger: #ff3b30;
    --muted: #888;
    --line: #e5e5ea;
    --blue: #007aff;
}

body {
    margin: 0;
    background: #f6f6f8;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
}

.iphone-dialer {
    width: 360px;
    height: 760px;
    background: #fff;
    border-radius: 38px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    position: relative;
}

/* Screens */
.screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

/* Header */
header {
    text-align: center;
    padding: 25px 10px 5px;
}

header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

header input {
    font-size: 32px;
    border: none;
    outline: none;
    text-align: center;
    width: 100%;
}

#addNumberText {
    color: var(--accent);
    font-size: 14px;
    margin-top: 5px;
    cursor: pointer;
}

/* Keypad */
.keys {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 35px 40px 0;
    justify-items: center;
}

.keys button {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    background: #f2f2f7;
    font-size: 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.keys button:active {
    background: #e5e5ea;
}

.keys button small {
    font-size: 10px;
    color: var(--muted);
    margin-top: 2px;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 20px;
    margin-left: 20px;
}

.call-btn {
    width: 70px;
    height: 70px;
    background: var(--accent);
    border-radius: 50%;
    border: none;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: 1px solid black;
    margin-left: 50px;
}

.back-btn {
    background: none;
    border: none;
    font-size: 26px;
    color: var(--muted);
}

/* Bottom nav */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    border-top: 1px solid var(--line);
    padding: 8px 0;
    background: #fff;
}

.tab {
    background: none;
    border: none;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tab span {
    font-size: 18px;
    margin-bottom: 3px;
}

.tab.active {
    color: var(--blue);
    font-weight: 600;
}

/* Recents */
.recents-header {
    text-align: left;
    padding: 18px 18px 8px;
    border-bottom: 1px solid var(--line);
}

.recents-header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #111;
    text-align: center;
}

.log-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
    width: 100%;
}

.log-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}

.log-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e5ea;
    color: #333;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
}

.log-text {
    display: flex;
    flex-direction: column;
}

.log-name {
    font-size: 16px;
    color: #111;
}

.log-sub {
    font-size: 12px;
    color: var(--muted);
}

.log-item.incoming .log-sub {
    color: var(--accent);
}

.log-right {
    color: var(--blue);
    font-size: 18px;
}

/* Active call */
.dark {
    background: #000;
    color: #fff;
    justify-content: space-around;
}

.call-info {
    text-align: center;
    margin-top: 120px;
}

.call-info h2 {
    margin: 0;
    font-size: 24px;
}

.call-info p {
    margin: 6px 0;
    color: #aaa;
}

#callTimer {
    font-size: 26px;
    margin-top: 8px;
}

.call-actions {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.round {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #2c2c2e;
    border: none;
    color: #fff;
    font-size: 26px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.round span {
    font-size: 12px;
    color: #ccc;
    margin-top: 4px;
}

/* Centered end button */
.call-center {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 60px;
}

.end-call {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--danger);
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}